home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / MSJV7_2B.ARJ / WINDOWS.H < prev   
C/C++ Source or Header  |  1992-03-01  |  147KB  |  5,220 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. *  WINDOWS.H - Windows APIs, types, and definitions                           *
  4. *                                                                             *
  5. *              Version 3.10 BETA III                                          *
  6. *                                                                             *
  7. *******************************************************************************
  8. *
  9. * The following symbols control inclusion of various parts of this file:
  10. *
  11. *  WINVER            - Windows version number (0x030a).  To exclude
  12. *                      definitions introduced in versions 3.1 (or above)
  13. *                      #define WINVER 0x0300 before #including windows.h
  14. *
  15. *  #define:           To prevent inclusion of:
  16. *
  17. *  NOGDICAPMASKS     - CC_*, LC_*, PC_*, CP_*, TC_*, RC_
  18. *  NOVIRTUALKEYCODES - VK_*
  19. *  NOWINMESSAGES     - WM_*, EM_*, LB_*, CB_*
  20. *  NOWINSTYLES         - WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_*
  21. *  NOSYSMETRICS      - SM_*
  22. *  NOMENUS         - MF_*
  23. *  NOICONS         - IDI_*
  24. *  NOKEYSTATES         - MK_*
  25. *  NOSYSCOMMANDS     - SC_*
  26. *  NORASTEROPS         - Binary and Tertiary raster ops
  27. *  NOSHOWWINDOW      - SW_*
  28. *  NOATOM         - Atom Manager routines
  29. *  NOCLIPBOARD         - Clipboard routines
  30. *  NOCOLOR         - Screen colors
  31. *  NOCTLMGR         - Control and Dialog routines
  32. *  NODRAWTEXT         - DrawText() and DT_*
  33. *  NOGDI         - All GDI defines and routines
  34. *  NOKERNEL         - All KERNEL defines and routines
  35. *  NOUSER         - All USER defines and routines
  36. *  NOMB          - MB_* and MessageBox()
  37. *  NOLOGERROR        - LogError()/LogParamError() definitions
  38. *  NOMEMMGR         - GMEM_*, LMEM_*, GHND, LHND, associated routines
  39. *  NOMETAFILE         - typedef METAFILEPICT
  40. *  NOMINMAX         - Macros min(a,b) and max(a,b)
  41. *  NOMSG         - typedef MSG and associated routines
  42. *  NOOEMRESOURCE     - OEM Resource values
  43. *  NOOPENFILE         - OpenFile(), OemToAnsi, AnsiToOem, and OF_*
  44. *  NOSCROLL         - SB_* and scrolling routines
  45. *  NOSOUND         - Sound driver routines
  46. *  NOTEXTMETRIC      - typedef TEXTMETRIC and associated routines
  47. *  NOWH          - SetWindowsHook and WH_*
  48. *  NOWINOFFSETS      - GWL_*, GCL_*, associated routines
  49. *  NOHELP         - Help engine interface.
  50. *  NOPROFILER         - Profiler interface.
  51. *  NODEFERWINDOWPOS  - DeferWindowPos routines
  52. *  NODRIVERS         - Installable driver defines
  53. *  NOCOMM            - Communications driver stuff
  54. *  NODBCS         - DBCS support stuff.
  55. *  NOSYSTEMPARAMSINFO- SystemParametersInfo (SPI_*)
  56. *  NOSCALABLEFONT    - Scalable font prototypes and data structures
  57. *  NOGDIOBJ         - GDI objects including pens, brushes and logfonts.
  58. *  NOBITMAP         - GDI bitmaps
  59. *
  60. \****************************************************************************/
  61.  
  62. #ifndef _INC_WINDOWS
  63. #define _INC_WINDOWS    /* #defined if windows.h has been included */
  64.  
  65. #ifndef RC_INVOKED
  66. #pragma pack(1)         /* Assume byte packing throughout */
  67. #endif
  68.  
  69. #ifdef __cplusplus
  70. extern "C" {            /* Assume C declarations for C++ */
  71. #endif    /* __cplusplus */
  72.  
  73. /* If WINVER is not defined, assume version 3.1 */
  74. #ifndef WINVER
  75. #define WINVER  0x030a
  76. #endif
  77.  
  78. #ifdef RC_INVOKED
  79. /* Don't include definitions that RC.EXE can't parse */
  80. #define NOATOM
  81. #define NOGDI
  82. #define NOGDICAPMASKS
  83. #define NOMETAFILE
  84. #define NOMINMAX
  85. #define NOMSG
  86. #define NOOPENFILE
  87. #define NORASTEROPS
  88. #define NOSCROLL
  89. #define NOSOUND
  90. #define NOSYSMETRICS
  91. #define NOTEXTMETRIC
  92. #define NOWH
  93. #define NODBCS
  94. #define NOSYSTEMPARAMSINFO
  95. #define NOCOMM
  96. #define NOOEMRESOURCE
  97. #endif /* RC_INVOKED */
  98.  
  99. /* Handle OEMRESOURCE for 3.0 compatibility */
  100. #if (WINVER < 0x030a)
  101. #define NOOEMRESOURCE
  102. #ifdef OEMRESOURCE
  103. #undef NOOEMRESOURCE
  104. #endif
  105. #endif
  106.  
  107. /******* Common definitions and typedefs ***********************************/
  108.  
  109. #define VOID            void
  110.  
  111. #define FAR                 _far
  112. #define NEAR            _near
  113. #define PASCAL            _pascal
  114. #define CDECL            _cdecl
  115.  
  116. #define WINAPI              _far _pascal
  117. #define CALLBACK            _far _pascal
  118.  
  119. /****** Simple types & common helper macros *********************************/
  120.  
  121. typedef int            BOOL;
  122. #define FALSE            0
  123. #define TRUE            1
  124.  
  125. typedef unsigned char        BYTE;
  126. typedef unsigned short      WORD;
  127. typedef unsigned long       DWORD;
  128.  
  129. typedef unsigned int        UINT;
  130.  
  131. #ifdef STRICT
  132. typedef signed long        LONG;
  133. #else
  134. #define LONG long
  135. #endif
  136.  
  137. #define LOBYTE(w)        ((BYTE)(w))
  138. #define HIBYTE(w)           ((BYTE)(((UINT)(w) >> 8) & 0xFF))
  139.  
  140. #define LOWORD(l)           ((WORD)(DWORD)(l))
  141. #define HIWORD(l)           ((WORD)((((DWORD)(l)) >> 16) & 0xFFFF))
  142.  
  143. #define MAKELONG(low, high) ((LONG)(((WORD)(low)) | ((DWORD)((WORD)(high))) << 16))
  144.  
  145. #ifndef NOMINMAX
  146. #ifndef max
  147. #define max(a,b)            (((a) > (b)) ? (a) : (b))
  148. #endif
  149. #ifndef min
  150. #define min(a,b)            (((a) < (b)) ? (a) : (b))
  151. #endif
  152. #endif  /* NOMINMAX */
  153.  
  154. /* Types use for passing & returning polymorphic values */
  155. typedef UINT WPARAM;
  156. typedef LONG LPARAM;
  157. typedef LONG LRESULT;
  158.  
  159. #define MAKELPARAM(low, high)    ((LPARAM)MAKELONG(low, high))
  160. #define MAKELRESULT(low, high)    ((LRESULT)MAKELONG(low, high))
  161.  
  162. /****** Common pointer types ************************************************/
  163.  
  164. #ifndef NULL
  165. #define NULL            0
  166. #endif
  167.  
  168. typedef char NEAR*          PSTR;
  169. typedef char NEAR*          NPSTR;
  170.  
  171.  
  172. typedef char FAR*           LPSTR;
  173. typedef const char FAR*     LPCSTR;
  174.  
  175. typedef BYTE NEAR*        PBYTE;
  176. typedef BYTE FAR*        LPBYTE;
  177.  
  178. typedef int NEAR*        PINT;
  179. typedef int FAR*        LPINT;
  180.  
  181. typedef WORD NEAR*          PWORD;
  182. typedef WORD FAR*           LPWORD;
  183.  
  184. typedef long NEAR*        PLONG;
  185. typedef long FAR*        LPLONG;
  186.  
  187. typedef DWORD NEAR*         PDWORD;
  188. typedef DWORD FAR*          LPDWORD;
  189.  
  190. typedef void FAR*           LPVOID;
  191.  
  192. #define MAKELP(sel, off)    ((void FAR*)MAKELONG((off), (sel)))
  193. #define SELECTOROF(lp)      HIWORD(lp)
  194. #define OFFSETOF(lp)        LOWORD(lp)
  195.  
  196. #define FIELDOFFSET(type, field)    ((int)(&((type NEAR*)1)->field)-1)
  197.  
  198. /****** Common handle types *************************************************/
  199.  
  200. #ifdef STRICT
  201. typedef void NEAR*              HANDLE;
  202. #define DECLARE_HANDLE(name)    typedef struct name##__ NEAR* name
  203. #else        /* STRICT */
  204. typedef UINT                    HANDLE;
  205. #define DECLARE_HANDLE(name)    typedef UINT name
  206. #endif        /* !STRICT */
  207.  
  208. typedef HANDLE*         PHANDLE;
  209. typedef HANDLE NEAR*        SPHANDLE;
  210. typedef HANDLE FAR*        LPHANDLE;
  211.  
  212. typedef HANDLE            HGLOBAL;
  213. typedef HANDLE            HLOCAL;
  214.  
  215. typedef HANDLE            GLOBALHANDLE;
  216. typedef HANDLE            LOCALHANDLE;
  217.  
  218. typedef UINT                ATOM;
  219.  
  220. #ifdef STRICT
  221. typedef void (CALLBACK*     FARPROC)(void);
  222. typedef void (NEAR PASCAL*  NEARPROC)(void);
  223. #else
  224. typedef int (CALLBACK*      FARPROC)();
  225. typedef int (NEAR PASCAL*   NEARPROC)();
  226. #endif
  227.  
  228. DECLARE_HANDLE(HSTR);
  229.  
  230. /****** KERNEL typedefs, structures, and functions **************************/
  231.  
  232. DECLARE_HANDLE(HINSTANCE);
  233. typedef HINSTANCE HMODULE;  /* HMODULEs can be used in place of HINSTANCEs */
  234.  
  235. #ifndef NOKERNEL
  236.  
  237. /****** Application entry point function ************************************/
  238.  
  239. #ifdef STRICT
  240. int PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
  241. #endif
  242.  
  243. /****** System Information **************************************************/
  244.  
  245. DWORD   WINAPI GetVersion(void);
  246.  
  247. DWORD   WINAPI GetFreeSpace(UINT);
  248. UINT    WINAPI GetCurrentPDB(void);
  249.  
  250. UINT    WINAPI GetWindowsDirectory(LPSTR, UINT);
  251. UINT    WINAPI GetSystemDirectory(LPSTR, UINT);
  252.  
  253. #if (WINVER >= 0x030a)
  254. UINT    WINAPI GetFreeSystemResources(UINT);
  255. #endif
  256.  
  257. DWORD   WINAPI GetWinFlags(void);
  258.  
  259. #define WF_PMODE    0x0001
  260. #define WF_CPU286    0x0002
  261. #define WF_CPU386    0x0004
  262. #define WF_CPU486    0x0008
  263. #define WF_STANDARD    0x0010
  264. #define WF_WIN286    0x0010
  265. #define WF_ENHANCED    0x0020
  266. #define WF_WIN386    0x0020
  267. #define WF_CPU086    0x0040
  268. #define WF_CPU186    0x0080
  269. #define WF_LARGEFRAME    0x0100
  270. #define WF_SMALLFRAME    0x0200
  271. #define WF_80x87    0x0400
  272. #define WF_PAGING    0x0800
  273. #define WF_WLO          0x8000
  274.                   
  275. LPSTR   WINAPI GetDOSEnvironment(void);
  276.  
  277. DWORD   WINAPI GetCurrentTime(void);
  278. DWORD   WINAPI GetTickCount(void);
  279. DWORD   WINAPI GetTimerResolution(void);
  280.  
  281. /****** Error handling ******************************************************/
  282.  
  283. #if (WINVER >= 0x030a)
  284.  
  285. #ifndef NOLOGERROR
  286.  
  287. void WINAPI LogError(UINT err, void FAR* lpInfo);
  288. void WINAPI LogParamError(UINT err, FARPROC lpfn, void FAR* param);
  289.  
  290. /****** LogParamError/LogError values */
  291.  
  292. /* Error modifier bits */
  293.  
  294. #define ERR_WARNING        0x8000
  295. #define ERR_PARAM        0x4000
  296.  
  297. #define ERR_SIZE_MASK        0x3000
  298. #define ERR_BYTE                0x1000
  299. #define ERR_WORD                0x2000
  300. #define ERR_DWORD               0x3000
  301.  
  302. /****** LogParamError() values */
  303.  
  304. /* Generic parameter values */
  305. #define ERR_BAD_VALUE           0x6001
  306. #define ERR_BAD_FLAGS           0x6002
  307. #define ERR_BAD_INDEX           0x6003
  308. #define ERR_BAD_DVALUE        0x7004
  309. #define ERR_BAD_DFLAGS        0x7005
  310. #define ERR_BAD_DINDEX        0x7006
  311. #define ERR_BAD_PTR        0x7007
  312. #define ERR_BAD_FUNC_PTR    0x7008
  313. #define ERR_BAD_SELECTOR        0x6009
  314. #define ERR_BAD_STRING_PTR    0x700a
  315. #define ERR_BAD_HANDLE          0x600b
  316.  
  317. /* KERNEL parameter errors */
  318. #define ERR_BAD_HINSTANCE       0x6020
  319. #define ERR_BAD_HMODULE         0x6021
  320. #define ERR_BAD_GLOBAL_HANDLE   0x6022
  321. #define ERR_BAD_LOCAL_HANDLE    0x6023
  322. #define ERR_BAD_ATOM            0x6024
  323. #define ERR_BAD_HFILE           0x6025
  324.  
  325. /* USER parameter errors */
  326. #define ERR_BAD_HWND            0x6040
  327. #define ERR_BAD_HMENU           0x6041
  328. #define ERR_BAD_HCURSOR         0x6042
  329. #define ERR_BAD_HICON           0x6043
  330. #define ERR_BAD_HDWP            0x6044
  331. #define ERR_BAD_CID             0x6045
  332. #define ERR_BAD_HDRVR           0x6046
  333.  
  334. /* GDI parameter errors */
  335. #define ERR_BAD_COORDS        0x7060
  336. #define ERR_BAD_GDI_OBJECT      0x6061
  337. #define ERR_BAD_HDC             0x6062
  338. #define ERR_BAD_HPEN            0x6063
  339. #define ERR_BAD_HFONT           0x6064
  340. #define ERR_BAD_HBRUSH          0x6065
  341. #define ERR_BAD_HBITMAP         0x6066
  342. #define ERR_BAD_HRGN            0x6067
  343. #define ERR_BAD_HPALETTE        0x6068
  344. #define ERR_BAD_HMETAFILE       0x6069
  345.  
  346.  
  347. /**** LogError() values */
  348.  
  349. /* KERNEL errors */
  350. #define ERR_GALLOC              0x0001
  351. #define ERR_GREALLOC            0x0002
  352. #define ERR_GLOCK               0x0003
  353. #define ERR_LALLOC              0x0004
  354. #define ERR_LREALLOC            0x0005
  355. #define ERR_LLOCK               0x0006
  356. #define ERR_ALLOCRES            0x0007
  357. #define ERR_LOCKRES             0x0008
  358. #define ERR_LOADMODULE          0x0009
  359.  
  360. /* USER errors */
  361. #define ERR_CREATEDLG           0x0040
  362. #define ERR_CREATEDLG2          0x0041
  363. #define ERR_REGISTERCLASS       0x0042
  364. #define ERR_DCBUSY              0x0043
  365. #define ERR_CREATEWND           0x0044
  366. #define ERR_STRUCEXTRA          0x0045
  367. #define ERR_LOADSTR             0x0046
  368. #define ERR_LOADMENU            0x0047
  369. #define ERR_NESTEDBEGINPAINT    0x0048
  370. #define ERR_BADINDEX            0x0049
  371. #define ERR_CREATEMENU          0x004a
  372.  
  373. /* GDI errors */
  374. #define ERR_CREATEDC            0x0080
  375. #define ERR_CREATEMETA          0x0081
  376. #define ERR_DELOBJSELECTED      0x0082
  377. #define ERR_SELBITMAP           0x0083
  378.  
  379. #endif  /* NOLOGERROR */
  380. #endif  /* WINVER >= 0x030a */
  381.  
  382. void    WINAPI FatalExit(int);
  383. void    WINAPI FatalAppExit(UINT, LPCSTR);
  384.  
  385. BOOL    WINAPI ExitWindows(DWORD dwReturnCode, UINT wReserved);
  386.  
  387. #define EW_RESTARTWINDOWS 0x42
  388. #if (WINVER >= 0x030a)
  389. #define EW_REBOOTSYSTEM   0x43
  390.  
  391. BOOL    WINAPI ExitWindowsExec(LPCSTR, LPCSTR);
  392. #endif /* WINVER >= 0x030a */
  393.  
  394. void    WINAPI DebugBreak(void);
  395. void    WINAPI OutputDebugString(LPCSTR);
  396.  
  397. /* SetErrorMode() constants */
  398. #define SEM_FAILCRITICALERRORS  0x0001
  399. #define SEM_NOGPFAULTERRORBOX   0x0002
  400. #define SEM_NOOPENFILEERRORBOX  0x8000
  401.  
  402. UINT    WINAPI SetErrorMode(UINT);
  403.  
  404. /****** Pointer validation **************************************************/
  405.  
  406. #if (WINVER >= 0x030a)
  407.  
  408. BOOL    WINAPI IsBadReadPtr(const void FAR* lp, UINT cb);
  409. BOOL    WINAPI IsBadWritePtr(void FAR* lp, UINT cb);
  410. BOOL    WINAPI IsBadHugeReadPtr(const void _huge* lp, DWORD cb);
  411. BOOL    WINAPI IsBadHugeWritePtr(void _huge* lp, DWORD cb);
  412. BOOL    WINAPI IsBadCodePtr(FARPROC lpfn);
  413. BOOL    WINAPI IsBadStringPtr(const void FAR* lpsz, UINT cchMax);
  414.  
  415. #endif  /* WINVER >= 0x030a */
  416.  
  417. /****** Profiling support ***************************************************/
  418.  
  419. #ifndef NOPROFILER
  420.  
  421. int     WINAPI ProfInsChk(void);
  422. void    WINAPI ProfSetup(int,int);
  423. void    WINAPI ProfSampRate(int,int);
  424. void    WINAPI ProfStart(void);
  425. void    WINAPI ProfStop(void);
  426. void    WINAPI ProfClear(void);
  427. void    WINAPI ProfFlush(void);
  428. void    WINAPI ProfFinish(void);
  429.  
  430. #endif /* NOPROFILER */
  431.  
  432. /****** Catch/Throw and stack management ************************************/
  433.  
  434. typedef UINT CATCHBUF[9];
  435. typedef UINT FAR* LPCATCHBUF;
  436.  
  437. int     WINAPI Catch(UINT FAR*);
  438. void    WINAPI Throw(const UINT FAR*, int);
  439.  
  440. void    WINAPI SwitchStackBack(void);
  441. void    WINAPI SwitchStackTo(UINT, UINT, UINT);
  442.  
  443. /****** Module Management ***************************************************/
  444.  
  445. #define HINSTANCE_ERROR ((HINSTANCE)32)
  446.  
  447.  
  448. HINSTANCE   WINAPI LoadModule(LPCSTR, LPVOID);
  449. BOOL        WINAPI FreeModule(HINSTANCE);
  450.  
  451. HINSTANCE   WINAPI LoadLibrary(LPCSTR);
  452. void        WINAPI FreeLibrary(HINSTANCE);
  453.  
  454. UINT    WINAPI WinExec(LPCSTR, UINT);
  455.  
  456. HMODULE WINAPI GetModuleHandle(LPCSTR);
  457.  
  458. int     WINAPI GetModuleUsage(HINSTANCE);
  459. int     WINAPI GetModuleFileName(HINSTANCE, LPSTR, int);
  460.  
  461. FARPROC WINAPI GetProcAddress(HINSTANCE, LPCSTR);
  462.  
  463. int     WINAPI GetInstanceData(HINSTANCE, BYTE*, int);
  464.  
  465. HGLOBAL WINAPI GetCodeHandle(FARPROC);
  466.  
  467.  
  468. typedef struct tagSEGINFO
  469. {
  470.     UINT offSegment;
  471.     UINT cbSegment;
  472.     UINT flags;
  473.     UINT cbAlloc;
  474.     HGLOBAL h;
  475.     UINT alignShift;
  476.     UINT reserved[2];
  477. } SEGINFO;
  478. typedef SEGINFO FAR* LPSEGINFO;
  479.  
  480. void    WINAPI GetCodeInfo(FARPROC lpProc, SEGINFO FAR* lpSegInfo);
  481.  
  482. FARPROC WINAPI MakeProcInstance(FARPROC, HINSTANCE);
  483. void    WINAPI FreeProcInstance(FARPROC);
  484.  
  485. LONG    WINAPI SetSwapAreaSize(UINT);
  486. void    WINAPI SwapRecording(UINT);
  487. void    WINAPI ValidateCodeSegments(void);
  488.  
  489. /* Windows Exit Procedure flag values */
  490. #define    WEP_SYSTEM_EXIT    1
  491. #define    WEP_FREE_DLL    0
  492.  
  493. /****** Task Management *****************************************************/
  494.  
  495. #endif    /* NOKERNEL */
  496.  
  497. DECLARE_HANDLE(HTASK);
  498.  
  499. #ifndef NOKERNEL
  500.  
  501. UINT    WINAPI GetNumTasks(void);
  502.  
  503. #if (WINVER >= 0x030a)
  504. BOOL    WINAPI IsTask(HTASK);
  505. #endif
  506.  
  507. HTASK   WINAPI GetCurrentTask(void);
  508.  
  509. void    WINAPI Yield(void);
  510. void    WINAPI DirectedYield(HTASK);
  511.  
  512. /****** Global memory management ********************************************/
  513.  
  514. #ifndef NOMEMMGR
  515.  
  516. /* Global Memory Flags */
  517.  
  518. #define GMEM_FIXED        0x0000
  519. #define GMEM_MOVEABLE        0x0002
  520. #define GMEM_NOCOMPACT        0x0010
  521. #define GMEM_NODISCARD        0x0020
  522. #define GMEM_ZEROINIT        0x0040
  523. #define GMEM_MODIFY        0x0080
  524. #define GMEM_DISCARDABLE    0x0100
  525. #define GMEM_NOT_BANKED     0x1000
  526. #define GMEM_SHARE        0x2000
  527. #define GMEM_DDESHARE        0x2000
  528. #define GMEM_NOTIFY        0x4000
  529. #define GMEM_LOWER        GMEM_NOT_BANKED
  530.  
  531. #define GHND            (GMEM_MOVEABLE | GMEM_ZEROINIT)
  532. #define GPTR            (GMEM_FIXED | GMEM_ZEROINIT)
  533.  
  534. #define GlobalDiscard(h)    GlobalReAlloc(h, 0L, GMEM_MOVEABLE)
  535.  
  536. HGLOBAL WINAPI GlobalAlloc(UINT, DWORD);
  537. HGLOBAL WINAPI GlobalReAlloc(HGLOBAL, DWORD, UINT);
  538. HGLOBAL WINAPI GlobalFree(HGLOBAL);
  539.  
  540. DWORD   WINAPI GlobalDosAlloc(DWORD);
  541. UINT    WINAPI GlobalDosFree(UINT);
  542.  
  543. #ifdef STRICT
  544. void FAR* WINAPI GlobalLock(HGLOBAL);
  545. #else
  546. char FAR* WINAPI GlobalLock(HGLOBAL);
  547. #endif
  548.  
  549. BOOL    WINAPI GlobalUnlock(HGLOBAL);
  550.  
  551. DWORD   WINAPI GlobalSize(HGLOBAL);
  552. DWORD   WINAPI GlobalHandle(UINT);
  553.  
  554. /* GlobalFlags return flags (in addition to GMEM_DISCARDABLE) */
  555. #define GMEM_DISCARDED        0x4000
  556. #define GMEM_LOCKCOUNT        0x00FF
  557. UINT    WINAPI GlobalFlags(HGLOBAL);
  558.  
  559. #ifdef STRICT
  560. void FAR* WINAPI GlobalWire(HGLOBAL);
  561. #else
  562. char FAR* WINAPI GlobalWire(HGLOBAL);
  563. #endif
  564.  
  565. BOOL    WINAPI GlobalUnWire(HGLOBAL);
  566.  
  567. UINT    WINAPI GlobalPageLock(HGLOBAL);
  568. UINT    WINAPI GlobalPageUnlock(HGLOBAL);
  569.  
  570. void    WINAPI GlobalFix(HGLOBAL);
  571. BOOL    WINAPI GlobalUnfix(HGLOBAL);
  572.  
  573. HGLOBAL WINAPI GlobalLRUNewest(HGLOBAL);
  574. HGLOBAL WINAPI GlobalLRUOldest(HGLOBAL);
  575.  
  576. DWORD   WINAPI GlobalCompact(DWORD);
  577.  
  578. #ifdef STRICT
  579. typedef BOOL (CALLBACK* GNOTIFYPROC)(HGLOBAL);
  580. #else
  581. typedef FARPROC GNOTIFYPROC;
  582. #endif
  583.  
  584. void    WINAPI GlobalNotify(GNOTIFYPROC);
  585.  
  586. HGLOBAL WINAPI LockSegment(UINT);
  587. BOOL    WINAPI UnlockSegment(UINT);
  588.  
  589. #define LockData(dummy)     LockSegment((UINT)-1)
  590. #define UnlockData(dummy)   UnlockSegment((UINT)-1)
  591.  
  592. UINT    WINAPI AllocSelector(UINT);
  593. UINT    WINAPI FreeSelector(UINT);
  594. UINT    WINAPI AllocDStoCSAlias(UINT);
  595. UINT    WINAPI ChangeSelector(UINT sourceSel, UINT destSel);
  596. DWORD   WINAPI GetSelectorBase(UINT);
  597. UINT    WINAPI SetSelectorBase(UINT, DWORD);
  598. DWORD   WINAPI GetSelectorLimit(UINT);
  599. UINT    WINAPI SetSelectorLimit(UINT, DWORD);
  600.  
  601. void    WINAPI LimitEmsPages(DWORD);
  602.  
  603. void    WINAPI ValidateFreeSpaces(void);
  604.  
  605. /* Low system memory notification message */
  606. #define WM_COMPACTING       0x0041
  607.  
  608. /***** Local Memory Management */
  609.  
  610. /* Local Memory Flags */
  611. #define LMEM_FIXED        0x0000
  612. #define LMEM_MOVEABLE        0x0002
  613. #define LMEM_NOCOMPACT        0x0010
  614. #define LMEM_NODISCARD        0x0020
  615. #define LMEM_ZEROINIT        0x0040
  616. #define LMEM_MODIFY        0x0080
  617. #define LMEM_DISCARDABLE    0x0F00
  618.  
  619. #define LHND            (LMEM_MOVEABLE | LMEM_ZEROINIT)
  620. #define LPTR            (LMEM_FIXED | LMEM_ZEROINIT)
  621.  
  622. #define NONZEROLHND        (LMEM_MOVEABLE)
  623. #define NONZEROLPTR        (LMEM_FIXED)
  624.  
  625.  
  626. #define LocalDiscard(h)     LocalReAlloc(h, 0, LMEM_MOVEABLE)
  627.  
  628.  
  629. HLOCAL  WINAPI LocalAlloc(UINT, UINT);
  630. HLOCAL  WINAPI LocalReAlloc(HLOCAL, UINT, UINT);
  631. HLOCAL  WINAPI LocalFree(HLOCAL);
  632.  
  633. #ifdef STRICT
  634. void NEAR* WINAPI LocalLock(HLOCAL);
  635. #else
  636. char NEAR* WINAPI LocalLock(HLOCAL);
  637. #endif
  638.  
  639. BOOL    WINAPI LocalUnlock(HLOCAL);
  640.  
  641. UINT    WINAPI LocalSize(HLOCAL);
  642. #ifdef STRICT
  643. HLOCAL  WINAPI LocalHandle(void NEAR*);
  644. #else
  645. HLOCAL  WINAPI LocalHandle(UINT);
  646. #endif
  647.  
  648. /* LocalFlags return flags (in addition to LMEM_DISCARDABLE) */
  649. #define LMEM_DISCARDED        0x4000
  650. #define LMEM_LOCKCOUNT        0x00FF
  651.  
  652. UINT    WINAPI LocalFlags(HLOCAL);
  653.  
  654. BOOL    WINAPI LocalInit(UINT, UINT, UINT);
  655. UINT    WINAPI LocalCompact(UINT);
  656. UINT    WINAPI LocalShrink(HLOCAL, UINT);
  657.  
  658. #endif /* NOMEMMGR */
  659.  
  660. /****** File I/O ************************************************************/
  661.  
  662. #ifndef NOLFILEIO
  663.  
  664. typedef int HFILE;      /* Polymorphic with C runtime file handle type */
  665.  
  666. #define HFILE_ERROR ((HFILE)-1)
  667.  
  668. #ifndef NOOPENFILE
  669.  
  670. /* OpenFile() Structure */
  671. typedef struct tagOFSTRUCT
  672. {
  673.     BYTE cBytes;
  674.     BYTE fFixedDisk;
  675.     UINT nErrCode;
  676.     BYTE reserved[4];
  677.     BYTE szPathName[128];
  678. } OFSTRUCT;
  679. typedef OFSTRUCT*       POFSTRUCT;
  680. typedef OFSTRUCT NEAR* NPOFSTRUCT;
  681. typedef OFSTRUCT FAR*  LPOFSTRUCT;
  682.  
  683. /* OpenFile() Flags */
  684. #define OF_READ         0x0000
  685. #define OF_WRITE        0x0001
  686. #define OF_READWRITE        0x0002
  687. #define OF_SHARE_COMPAT        0x0000
  688. #define OF_SHARE_EXCLUSIVE  0x0010
  689. #define OF_SHARE_DENY_WRITE 0x0020
  690. #define OF_SHARE_DENY_READ  0x0030
  691. #define OF_SHARE_DENY_NONE  0x0040
  692. #define OF_PARSE        0x0100
  693. #define OF_DELETE        0x0200
  694. #define OF_VERIFY        0x0400      /* Used with OF_REOPEN */
  695. #define OF_SEARCH        0x0400    /* Used without OF_REOPEN */
  696. #define OF_CANCEL        0x0800
  697. #define OF_CREATE        0x1000
  698. #define OF_PROMPT        0x2000
  699. #define OF_EXIST        0x4000
  700. #define OF_REOPEN        0x8000
  701.  
  702. HFILE   WINAPI OpenFile(LPCSTR, OFSTRUCT FAR*, UINT);
  703.  
  704. #endif /* NOOPENFILE */
  705.  
  706. /* _lopen() flags */
  707. #define READ        0
  708. #define WRITE       1
  709. #define READ_WRITE  2
  710.  
  711. HFILE   WINAPI _lopen(LPCSTR, int);
  712. HFILE   WINAPI _lcreat(LPCSTR, int);
  713.  
  714. HFILE   WINAPI _lclose(HFILE);
  715.  
  716. LONG    WINAPI _llseek(HFILE, LONG, int);
  717.  
  718. UINT    WINAPI _lread(HFILE, void _huge*, UINT);
  719. UINT    WINAPI _lwrite(HFILE, const void _huge*, UINT);
  720.  
  721.  
  722. #endif    /* NOLFILEIO */
  723.  
  724. /* GetTempFileName() Flags */
  725. #define TF_FORCEDRIVE        (BYTE)0x80
  726.  
  727. int     WINAPI GetTempFileName(BYTE, LPCSTR, UINT, LPSTR);
  728. BYTE    WINAPI GetTempDrive(char);
  729.  
  730. /* GetDriveType return values */
  731. #define DRIVE_REMOVABLE 2
  732. #define DRIVE_FIXED     3
  733. #define DRIVE_REMOTE    4
  734. UINT    WINAPI GetDriveType(int);
  735.  
  736. UINT    WINAPI SetHandleCount(UINT);
  737.  
  738. /****** Network support *****************************************************/
  739. UINT WINAPI WNetAddConnection(LPSTR, LPSTR, LPSTR);
  740. UINT WINAPI WNetGetConnection(LPSTR, LPSTR, UINT FAR*);
  741. UINT WINAPI WNetCancelConnection(LPSTR, BOOL);
  742. /* Errors */
  743. #define WN_SUCCESS            0x0000
  744. #define WN_NOT_SUPPORTED        0x0001
  745. #define WN_NET_ERROR            0x0002
  746. #define WN_MORE_DATA            0x0003
  747. #define WN_BAD_POINTER            0x0004
  748. #define WN_BAD_VALUE            0x0005
  749. #define WN_BAD_PASSWORD                 0x0006
  750. #define WN_ACCESS_DENIED        0x0007
  751. #define WN_FUNCTION_BUSY        0x0008
  752. #define WN_WINDOWS_ERROR        0x0009
  753. #define WN_BAD_USER            0x000A
  754. #define WN_OUT_OF_MEMORY        0x000B
  755. #define WN_CANCEL            0x000C
  756. #define WN_CONTINUE            0x000D
  757.  
  758. /* Connection errors */
  759. #define WN_NOT_CONNECTED        0x0030
  760. #define WN_OPEN_FILES            0x0031
  761. #define WN_BAD_NETNAME            0x0032
  762. #define WN_BAD_LOCALNAME        0x0033
  763. #define WN_ALREADY_CONNECTED        0x0034
  764. #define WN_DEVICE_ERROR         0x0035
  765. #define WN_CONNECTION_CLOSED        0x0036
  766.  
  767. /****** Resource Management *************************************************/
  768.  
  769. DECLARE_HANDLE(HRSRC);
  770.  
  771. HRSRC   WINAPI FindResource(HINSTANCE, LPCSTR, LPCSTR);
  772. HGLOBAL WINAPI LoadResource(HINSTANCE, HRSRC);
  773. BOOL    WINAPI FreeResource(HGLOBAL);
  774.  
  775. #ifdef STRICT
  776. void FAR* WINAPI LockResource(HGLOBAL);
  777. #else
  778. char FAR* WINAPI LockResource(HGLOBAL);
  779. #endif
  780.  
  781. #define     UnlockResource(h)        GlobalUnlock(h)
  782.  
  783. DWORD   WINAPI SizeofResource(HINSTANCE, HRSRC);
  784.  
  785. int     WINAPI AccessResource(HINSTANCE, HRSRC);
  786.  
  787. HGLOBAL WINAPI AllocResource(HINSTANCE, HRSRC, DWORD);
  788.  
  789. #ifdef STRICT
  790. typedef HGLOBAL (CALLBACK* RSRCHDLRPROC)(HGLOBAL, HINSTANCE, HRSRC);
  791. #else
  792. typedef FARPROC RSRCHDLRPROC;
  793. #endif
  794.  
  795. RSRCHDLRPROC WINAPI SetResourceHandler(HINSTANCE, LPCSTR, RSRCHDLRPROC);
  796.  
  797. #define MAKEINTRESOURCE(i)  ((LPCSTR)MAKELP(NULL, (i)))
  798.  
  799. #ifndef NORESOURCE
  800.  
  801. /* Predefined Resource Types */
  802. #define RT_CURSOR        MAKEINTRESOURCE(1)
  803. #define RT_BITMAP        MAKEINTRESOURCE(2)
  804. #define RT_ICON         MAKEINTRESOURCE(3)
  805. #define RT_MENU         MAKEINTRESOURCE(4)
  806. #define RT_DIALOG        MAKEINTRESOURCE(5)
  807. #define RT_STRING        MAKEINTRESOURCE(6)
  808. #define RT_FONTDIR        MAKEINTRESOURCE(7)
  809. #define RT_FONT         MAKEINTRESOURCE(8)
  810. #define RT_ACCELERATOR        MAKEINTRESOURCE(9)
  811. #define RT_RCDATA        MAKEINTRESOURCE(10)
  812.  
  813. #define RT_GROUP_CURSOR     MAKEINTRESOURCE(12)
  814. #define RT_GROUP_ICON        MAKEINTRESOURCE(14)
  815.  
  816. #endif /* NORESOURCE */
  817.  
  818. #ifdef OEMRESOURCE
  819.  
  820. /* OEM Resource Ordinal Numbers */
  821. #define OBM_CLOSE        32754
  822. #define OBM_UPARROW         32753
  823. #define OBM_DNARROW         32752
  824. #define OBM_RGARROW         32751
  825. #define OBM_LFARROW         32750
  826. #define OBM_REDUCE          32749
  827. #define OBM_ZOOM            32748
  828. #define OBM_RESTORE         32747
  829. #define OBM_REDUCED         32746
  830. #define OBM_ZOOMD           32745
  831. #define OBM_RESTORED        32744
  832. #define OBM_UPARROWD        32743
  833. #define OBM_DNARROWD        32742
  834. #define OBM_RGARROWD        32741
  835. #define OBM_LFARROWD        32740
  836. #define OBM_MNARROW         32739
  837. #define OBM_COMBO           32738
  838. #if (WINVER >= 0x030a)
  839. #define OBM_UPARROWI        32737
  840. #define OBM_DNARROWI        32736
  841. #define OBM_RGARROWI        32735
  842. #define OBM_LFARROWI        32734
  843. #endif /* WINVER >= 0x030a */
  844.  
  845. #define OBM_OLD_CLOSE       32767
  846. #define OBM_SIZE            32766
  847. #define OBM_OLD_UPARROW     32765
  848. #define OBM_OLD_DNARROW     32764
  849. #define OBM_OLD_RGARROW     32763
  850. #define OBM_OLD_LFARROW     32762
  851. #define OBM_BTSIZE          32761
  852. #define OBM_CHECK           32760
  853. #define OBM_CHECKBOXES      32759
  854. #define OBM_BTNCORNERS      32758
  855. #define OBM_OLD_REDUCE      32757
  856. #define OBM_OLD_ZOOM        32756
  857. #define OBM_OLD_RESTORE     32755
  858.  
  859. #define OCR_NORMAL        32512
  860. #define OCR_IBEAM        32513
  861. #define OCR_WAIT        32514
  862. #define OCR_CROSS        32515
  863. #define OCR_UP            32516
  864. #define OCR_SIZE        32640
  865. #define OCR_ICON        32641
  866. #define OCR_SIZENWSE        32642
  867. #define OCR_SIZENESW        32643
  868. #define OCR_SIZEWE        32644
  869. #define OCR_SIZENS        32645
  870. #define OCR_SIZEALL        32646
  871. #define OCR_ICOCUR        32647
  872.  
  873. #define OIC_SAMPLE        32512
  874. #define OIC_HAND        32513
  875. #define OIC_QUES        32514
  876. #define OIC_BANG        32515
  877. #define OIC_NOTE        32516
  878.  
  879. #endif /* OEMRESOURCE */
  880.  
  881. /****** Atom Management *****************************************************/
  882.  
  883. #define MAKEINTATOM(i)        ((LPCSTR)MAKELP(NULL, (i)))
  884.  
  885. #ifndef NOATOM
  886.  
  887. BOOL    WINAPI InitAtomTable(int);
  888. ATOM    WINAPI AddAtom(LPCSTR);
  889. ATOM    WINAPI DeleteAtom(ATOM);
  890. ATOM    WINAPI FindAtom(LPCSTR);
  891. UINT    WINAPI GetAtomName(ATOM, LPSTR, int);
  892. ATOM    WINAPI GlobalAddAtom(LPCSTR);
  893. ATOM    WINAPI GlobalDeleteAtom(ATOM);
  894. ATOM    WINAPI GlobalFindAtom(LPCSTR);
  895. UINT    WINAPI GlobalGetAtomName(ATOM, LPSTR, int);
  896. HLOCAL  WINAPI GetAtomHandle(ATOM);
  897.  
  898. #endif /* NOATOM */
  899.  
  900. /****** WIN.INI Support *****************************************************/
  901.  
  902. /* User Profile Routines */
  903. UINT    WINAPI GetProfileInt(LPCSTR, LPCSTR, int);
  904. int     WINAPI GetProfileString(LPCSTR, LPCSTR, LPCSTR, LPSTR, int);
  905. BOOL    WINAPI WriteProfileString(LPCSTR, LPCSTR, LPCSTR);
  906.  
  907. UINT    WINAPI GetPrivateProfileInt(LPCSTR, LPCSTR, int, LPCSTR);
  908. int     WINAPI GetPrivateProfileString(LPCSTR, LPCSTR, LPCSTR, LPSTR, int, LPCSTR);
  909. BOOL    WINAPI WritePrivateProfileString(LPCSTR, LPCSTR, LPCSTR, LPCSTR);
  910.  
  911. #define WM_WININICHANGE        0x001A
  912.  
  913. /****** International & Char Translation Support ****************************/
  914.  
  915. void    WINAPI AnsiToOem(const char _huge*, char _huge*);
  916. void    WINAPI OemToAnsi(const char _huge*, char _huge*);
  917.  
  918. void    WINAPI AnsiToOemBuff(LPCSTR, LPSTR, UINT);
  919. void    WINAPI OemToAnsiBuff(LPCSTR, LPSTR, UINT);
  920.  
  921. LPSTR   WINAPI AnsiNext(LPCSTR);
  922. LPSTR   WINAPI AnsiPrev(LPCSTR, LPCSTR);
  923.  
  924. LPSTR   WINAPI AnsiUpper(LPSTR);
  925. LPSTR   WINAPI AnsiLower(LPSTR);
  926.  
  927. UINT    WINAPI AnsiUpperBuff(LPSTR, UINT);
  928. UINT    WINAPI AnsiLowerBuff(LPSTR, UINT);
  929.  
  930.  
  931. #ifndef  NOLANGUAGE
  932. BOOL    WINAPI IsCharAlpha(char);
  933. BOOL    WINAPI IsCharAlphaNumeric(char);
  934. BOOL    WINAPI IsCharUpper(char);
  935. BOOL    WINAPI IsCharLower(char);
  936. #endif
  937.  
  938. #ifndef NOLSTRING
  939. int     WINAPI lstrcmp(LPCSTR, LPCSTR);
  940. int     WINAPI lstrcmpi(LPCSTR, LPCSTR);
  941. LPSTR   WINAPI lstrcpy(LPSTR, LPCSTR);
  942. LPSTR   WINAPI lstrcat(LPSTR, LPCSTR);
  943. int     WINAPI lstrlen(LPCSTR);
  944. #endif    /* NOLSTRING */
  945.  
  946. #if (WINVER >= 0x030a)
  947. #ifndef NODBCS
  948. BOOL    WINAPI IsDBCSLeadByte(BYTE);
  949. #endif    /* NODBCS */
  950. #endif  /* WINVER >= 0x030a */
  951.  
  952. int     WINAPI LoadString(HINSTANCE, UINT, LPSTR, int);
  953.  
  954. /****** Keyboard Driver Functions *******************************************/
  955.  
  956. #ifndef    NOKEYBOARDINFO
  957.  
  958. DWORD   WINAPI OemKeyScan(UINT);
  959. UINT    WINAPI VkKeyScan(UINT);
  960. int     WINAPI GetKeyboardType(int);
  961. UINT    WINAPI MapVirtualKey(UINT, UINT);
  962. int     WINAPI GetKBCodePage(void);
  963. int     WINAPI GetKeyNameText(LONG, LPSTR, int);
  964. int     WINAPI ToAscii(UINT wVirtKey, UINT wScanCode, BYTE FAR* lpKeyState, DWORD FAR* lpChar, UINT wFlags);
  965.  
  966. #endif
  967.  
  968. #endif /* NOKERNEL */
  969.  
  970. /****** GDI typedefs, structures, and functions *****************************/
  971.  
  972. DECLARE_HANDLE(HDC);
  973.  
  974. #ifndef NOGDI
  975.  
  976. #ifdef STRICT
  977. typedef void NEAR* HGDIOBJ;
  978. #else
  979. DECLARE_HANDLE(HGDIOBJ);
  980. #endif
  981.  
  982. #endif    /* NOGDI */
  983.  
  984. DECLARE_HANDLE(HBITMAP);
  985. DECLARE_HANDLE(HPEN);
  986. DECLARE_HANDLE(HBRUSH);
  987. DECLARE_HANDLE(HRGN);
  988. DECLARE_HANDLE(HPALETTE);
  989. DECLARE_HANDLE(HFONT);
  990.  
  991. typedef struct tagRECT
  992. {
  993.     int left;
  994.     int top;
  995.     int right;
  996.     int bottom;
  997. } RECT;
  998. typedef RECT*      PRECT;
  999. typedef RECT NEAR* NPRECT;
  1000. typedef RECT FAR*  LPRECT;
  1001.  
  1002. typedef struct tagPOINT
  1003. {
  1004.     int x;
  1005.     int y;
  1006. } POINT;
  1007. typedef POINT*       PPOINT;
  1008. typedef POINT NEAR* NPPOINT;
  1009. typedef POINT FAR*  LPPOINT;
  1010.  
  1011. #if (WINVER >= 0x030a)
  1012. typedef struct tagSIZE
  1013. {
  1014.     int cx;
  1015.     int cy;
  1016. } SIZE;
  1017. typedef SIZE*       PSIZE;
  1018. typedef SIZE NEAR* NPSIZE;
  1019. typedef SIZE FAR*  LPSIZE;
  1020. #endif  /* WINVER >= 0x030a */
  1021.  
  1022. #define MAKEPOINT(l)        (*((POINT FAR*)&(l)))
  1023.  
  1024. #ifndef NOGDI
  1025.  
  1026. /****** DC Management *******************************************************/
  1027.  
  1028. HDC     WINAPI CreateDC(LPCSTR, LPCSTR, LPCSTR, const void FAR*);
  1029. HDC     WINAPI CreateIC(LPCSTR, LPCSTR, LPCSTR, const void FAR*);
  1030. HDC     WINAPI CreateCompatibleDC(HDC);
  1031.  
  1032. BOOL    WINAPI DeleteDC(HDC);
  1033.  
  1034. DWORD   WINAPI GetDCOrg(HDC);
  1035.  
  1036. int     WINAPI SaveDC(HDC);
  1037. BOOL    WINAPI RestoreDC(HDC, int);
  1038.  
  1039. int     WINAPI SetEnvironment(LPCSTR, const void FAR*, UINT);
  1040. int     WINAPI GetEnvironment(LPCSTR, void FAR*, UINT);
  1041.  
  1042. int     WINAPI MulDiv(int, int, int);
  1043.  
  1044. #if (WINVER >= 0x030a)
  1045. /* Drawing bounds accumulation APIs */
  1046. UINT    WINAPI SetBoundsRect(HDC hDC, const RECT FAR* lprcBounds, UINT flags);
  1047. UINT    WINAPI GetBoundsRect(HDC hDC, RECT FAR* lprcBounds, UINT flags);
  1048.  
  1049. #define DCB_RESET       0x0001
  1050. #define DCB_ACCUMULATE  0x0002
  1051. #define DCB_DIRTY    DCB_ACCUMULATE
  1052. #define DCB_SET     (DCB_RESET | DCB_ACCUMULATE)
  1053. #define DCB_ENABLE      0x0004
  1054. #define DCB_DISABLE     0x0008
  1055.  
  1056. #endif  /* WINVER >= 0x030a */
  1057.  
  1058. /****** Device Capabilities *************************************************/
  1059.  
  1060. int WINAPI GetDeviceCaps(HDC, int);
  1061.  
  1062. /* Device Parameters for GetDeviceCaps() */
  1063. #define DRIVERVERSION 0
  1064. #define TECHNOLOGY    2
  1065. #define HORZSIZE      4
  1066. #define VERTSIZE      6
  1067. #define HORZRES       8
  1068. #define VERTRES       10
  1069. #define BITSPIXEL     12
  1070. #define PLANES        14
  1071. #define NUMBRUSHES    16
  1072. #define NUMPENS       18
  1073. #define NUMMARKERS    20
  1074. #define NUMFONTS      22
  1075. #define NUMCOLORS     24
  1076. #define PDEVICESIZE   26
  1077. #define CURVECAPS     28
  1078. #define LINECAPS      30
  1079. #define POLYGONALCAPS 32
  1080. #define TEXTCAPS      34
  1081. #define CLIPCAPS      36
  1082. #define RASTERCAPS    38
  1083. #define ASPECTX       40
  1084. #define ASPECTY       42
  1085. #define ASPECTXY      44
  1086.  
  1087. #define LOGPIXELSX    88
  1088. #define LOGPIXELSY    90
  1089.  
  1090. #define SIZEPALETTE  104
  1091. #define NUMRESERVED  106
  1092. #define COLORRES     108
  1093.  
  1094. #ifndef NOGDICAPMASKS
  1095.  
  1096. /* GetDeviceCaps() return value masks */
  1097.  
  1098. /* TECHNOLOGY */
  1099. #define DT_PLOTTER          0
  1100. #define DT_RASDISPLAY       1
  1101. #define DT_RASPRINTER       2
  1102. #define DT_RASCAMERA        3
  1103. #define DT_CHARSTREAM       4
  1104. #define DT_METAFILE         5
  1105. #define DT_DISPFILE         6
  1106.  
  1107. /* CURVECAPS */
  1108. #define CC_NONE             0x0000
  1109. #define CC_CIRCLES          0x0001
  1110. #define CC_PIE              0x0002
  1111. #define CC_CHORD            0x0004
  1112. #define CC_ELLIPSES         0x0008
  1113. #define CC_WIDE             0x0010
  1114. #define CC_STYLED           0x0020
  1115. #define CC_WIDESTYLED       0x0040
  1116. #define CC_INTERIORS        0x0080
  1117. #define CC_ROUNDRECT        0x0100
  1118.  
  1119. /* LINECAPS */
  1120. #define LC_NONE             0x0000
  1121. #define LC_POLYLINE         0x0002
  1122. #define LC_MARKER           0x0004
  1123. #define LC_POLYMARKER       0x0008
  1124. #define LC_WIDE             0x0010
  1125. #define LC_STYLED           0x0020
  1126. #define LC_WIDESTYLED       0x0040
  1127. #define LC_INTERIORS        0x0080
  1128.  
  1129. /* POLYGONALCAPS */
  1130. #define PC_NONE             0x0000
  1131. #define PC_POLYGON          0x0001
  1132. #define PC_RECTANGLE        0x0002
  1133. #define PC_WINDPOLYGON      0x0004
  1134. #define PC_SCANLINE         0x0008
  1135. #define PC_WIDE             0x0010
  1136. #define PC_STYLED           0x0020
  1137. #define PC_WIDESTYLED       0x0040
  1138. #define PC_INTERIORS        0x0080
  1139.  
  1140. /* TEXTCAPS */
  1141. #define TC_OP_CHARACTER     0x0001
  1142. #define TC_OP_STROKE        0x0002
  1143. #define TC_CP_STROKE        0x0004
  1144. #define TC_CR_90            0x0008
  1145. #define TC_CR_ANY           0x0010
  1146. #define TC_SF_X_YINDEP      0x0020
  1147. #define TC_SA_DOUBLE        0x0040
  1148. #define TC_SA_INTEGER       0x0080
  1149. #define TC_SA_CONTIN        0x0100
  1150. #define TC_EA_DOUBLE        0x0200
  1151. #define TC_IA_ABLE          0x0400
  1152. #define TC_UA_ABLE          0x0800
  1153. #define TC_SO_ABLE          0x1000
  1154. #define TC_RA_ABLE          0x2000
  1155. #define TC_VA_ABLE          0x4000
  1156. #define TC_RESERVED         0x8000
  1157.  
  1158. /* CLIPCAPS */
  1159. #define CP_NONE             0x0000
  1160. #define CP_RECTANGLE        0x0001
  1161. #define CP_REGION           0x0002
  1162.  
  1163. /* RASTERCAPS */
  1164. #define RC_NONE
  1165. #define RC_BITBLT           0x0001
  1166. #define RC_BANDING          0x0002
  1167. #define RC_SCALING          0x0004
  1168. #define RC_BITMAP64         0x0008
  1169. #define RC_GDI20_OUTPUT     0x0010
  1170. #define RC_GDI20_STATE      0x0020
  1171. #define RC_SAVEBITMAP       0x0040
  1172. #define RC_DI_BITMAP        0x0080
  1173. #define RC_PALETTE          0x0100
  1174. #define RC_DIBTODEV         0x0200
  1175. #define RC_BIGFONT          0x0400
  1176. #define RC_STRETCHBLT       0x0800
  1177. #define RC_FLOODFILL        0x1000
  1178. #define RC_STRETCHDIB       0x2000
  1179. #define RC_OP_DX_OUTPUT     0x4000
  1180. #define RC_DEVBITS          0x8000
  1181.  
  1182. #endif /* NOGDICAPMASKS */
  1183.  
  1184. /****** Coordinate transformation support ***********************************/
  1185.  
  1186. int     WINAPI SetMapMode(HDC, int);
  1187. int     WINAPI GetMapMode(HDC);
  1188.  
  1189. /* Map modes */
  1190. #define MM_TEXT            1
  1191. #define MM_LOMETRIC        2
  1192. #define MM_HIMETRIC        3
  1193. #define MM_LOENGLISH        4
  1194. #define MM_HIENGLISH        5
  1195. #define MM_TWIPS        6
  1196. #define MM_ISOTROPIC        7
  1197. #define MM_ANISOTROPIC        8
  1198.  
  1199. DWORD   WINAPI SetWindowOrg(HDC, int, int);
  1200. DWORD   WINAPI GetWindowOrg(HDC);
  1201. BOOL    WINAPI SetWindowOrgEx(HDC, int, int, POINT FAR*);
  1202. BOOL    WINAPI GetWindowOrgEx(HDC, POINT FAR*);
  1203.  
  1204. DWORD   WINAPI SetWindowExt(HDC, int, int);
  1205. DWORD   WINAPI GetWindowExt(HDC);
  1206. #if (WINVER >= 0x030a)
  1207. BOOL    WINAPI SetWindowExtEx(HDC, int, int, SIZE FAR*);
  1208. BOOL    WINAPI GetWindowExtEx(HDC, SIZE FAR*);
  1209. #endif  /* WINVER >= 0x030a */
  1210. DWORD   WINAPI OffsetWindowOrg(HDC, int, int);
  1211. BOOL    WINAPI OffsetWindowOrgEx(HDC, int, int, POINT FAR*);
  1212.  
  1213. DWORD   WINAPI ScaleWindowExt(HDC, int, int, int, int);
  1214. #if (WINVER >= 0x030a)
  1215. BOOL    WINAPI ScaleWindowExtEx(HDC, int, int, int, int, SIZE FAR*);
  1216. #endif  /* WINVER >= 0x030a */
  1217. DWORD   WINAPI SetViewportOrg(HDC, int, int);
  1218. DWORD   WINAPI GetViewportOrg(HDC);
  1219. #if (WINVER >= 0x030a)
  1220. BOOL    WINAPI SetViewportExtEx(HDC, int, int, SIZE FAR*);
  1221. BOOL    WINAPI GetViewportExtEx(HDC, SIZE FAR*);
  1222. #endif  /* WINVER >= 0x030a */
  1223. DWORD   WINAPI SetViewportExt(HDC, int, int);
  1224. DWORD   WINAPI GetViewportExt(HDC);
  1225. BOOL    WINAPI SetViewportOrgEx(HDC, int, int, POINT FAR*);
  1226. BOOL    WINAPI GetViewportOrgEx(HDC, POINT FAR*);
  1227.  
  1228. DWORD   WINAPI OffsetViewportOrg(HDC, int, int);
  1229. BOOL    WINAPI OffsetViewportOrgEx(HDC, int, int, POINT FAR*);
  1230.  
  1231. DWORD   WINAPI ScaleViewportExt(HDC, int, int, int, int);
  1232. #if (WINVER >= 0x030a)
  1233. BOOL    WINAPI ScaleViewportExtEx(HDC, int, int, int, int, SIZE FAR*);
  1234. #endif  /* WINVER >= 0x030a */
  1235. BOOL    WINAPI DPtoLP(HDC, POINT FAR*, int);
  1236. BOOL    WINAPI LPtoDP(HDC, POINT FAR*, int);
  1237.  
  1238.  
  1239. /* Coordinate Modes */
  1240. #define ABSOLUTE    1
  1241. #define RELATIVE    2
  1242.  
  1243. /****** Color support *******************************************************/
  1244.  
  1245. typedef DWORD COLORREF;
  1246.  
  1247. #define RGB(r,g,b)          ((COLORREF)(((BYTE)(r)|((WORD)(g)<<8))|(((DWORD)(BYTE)(b))<<16)))
  1248.  
  1249. #define GetRValue(rgb)        ((BYTE)(rgb))
  1250. #define GetGValue(rgb)      ((BYTE)(((WORD)(rgb)) >> 8))
  1251. #define GetBValue(rgb)        ((BYTE)((rgb)>>16))
  1252.  
  1253. COLORREF WINAPI GetNearestColor(HDC, COLORREF);
  1254.  
  1255. #ifndef NOCOLOR
  1256.  
  1257. COLORREF WINAPI GetSysColor(int);
  1258. void    WINAPI SetSysColors(int, const int FAR*, const COLORREF FAR*);
  1259.  
  1260. #define COLOR_SCROLLBAR           0
  1261. #define COLOR_BACKGROUND       1
  1262. #define COLOR_ACTIVECAPTION       2
  1263. #define COLOR_INACTIVECAPTION       3
  1264. #define COLOR_MENU           4
  1265. #define COLOR_WINDOW           5
  1266. #define COLOR_WINDOWFRAME       6
  1267. #define COLOR_MENUTEXT           7
  1268. #define COLOR_WINDOWTEXT       8
  1269. #define COLOR_CAPTIONTEXT         9
  1270. #define COLOR_ACTIVEBORDER      10
  1271. #define COLOR_INACTIVEBORDER      11
  1272. #define COLOR_APPWORKSPACE      12
  1273. #define COLOR_HIGHLIGHT          13
  1274. #define COLOR_HIGHLIGHTTEXT      14
  1275. #define COLOR_BTNFACE             15
  1276. #define COLOR_BTNSHADOW           16
  1277. #define COLOR_GRAYTEXT            17
  1278. #define COLOR_BTNTEXT          18
  1279. #if (WINVER >= 0x030a)
  1280. #define COLOR_INACTIVECAPTIONTEXT 19
  1281. #define COLOR_BTNHIGHLIGHT        20
  1282. #endif  /* WINVER >= 0x030a */
  1283.  
  1284. #endif /* NOCOLOR */
  1285.  
  1286. #define WM_SYSCOLORCHANGE   0x0015
  1287.  
  1288. /****** GDI Object Support **************************************************/
  1289.  
  1290. #ifndef NOGDIOBJ
  1291.  
  1292. HGDIOBJ WINAPI GetStockObject(int);
  1293.  
  1294. BOOL    WINAPI IsGDIObject(HGDIOBJ);
  1295.  
  1296. BOOL    WINAPI DeleteObject(HGDIOBJ);
  1297. HGDIOBJ WINAPI SelectObject(HDC, HGDIOBJ);
  1298. int     WINAPI GetObject(HGDIOBJ, int, void FAR*);
  1299. BOOL    WINAPI UnrealizeObject(HGDIOBJ);
  1300.  
  1301. #ifdef STRICT
  1302. typedef (CALLBACK* GOBJENUMPROC)(void FAR*, LPARAM);
  1303. #else
  1304. typedef FARPROC GOBJENUMPROC;
  1305. #endif
  1306.  
  1307. #ifdef STRICT
  1308. int     WINAPI EnumObjects(HDC, int, GOBJENUMPROC, LPARAM);
  1309. #else
  1310. int     WINAPI EnumObjects(HDC, int, GOBJENUMPROC, LPSTR);
  1311. #endif
  1312.  
  1313. /* Object types for EnumObjects() */
  1314. #define OBJ_PEN         1
  1315. #define OBJ_BRUSH        2
  1316.  
  1317. /****** Pen support *********************************************************/
  1318.  
  1319. /* Logical Pen */
  1320. typedef struct tagLOGPEN
  1321. {
  1322.     UINT    lopnStyle;
  1323.     POINT   lopnWidth;
  1324.     COLORREF lopnColor;
  1325. } LOGPEN;
  1326. typedef LOGPEN*       PLOGPEN;
  1327. typedef LOGPEN NEAR* NPLOGPEN;
  1328. typedef LOGPEN FAR*  LPLOGPEN;
  1329.  
  1330. /* Pen Styles */
  1331. #define PS_SOLID        0
  1332. #define PS_DASH             1
  1333. #define PS_DOT              2
  1334. #define PS_DASHDOT          3
  1335. #define PS_DASHDOTDOT       4
  1336. #define PS_NULL         5
  1337. #define PS_INSIDEFRAME         6
  1338.  
  1339. HPEN    WINAPI CreatePen(int, int, COLORREF);
  1340. HPEN    WINAPI CreatePenIndirect(LOGPEN FAR*);
  1341.  
  1342. /* Stock pens for use with GetStockObject(); */
  1343. #define WHITE_PEN        6
  1344. #define BLACK_PEN        7
  1345. #define NULL_PEN        8
  1346.  
  1347. /****** Brush support *******************************************************/
  1348.  
  1349. /* Brush Styles */
  1350. #define BS_SOLID        0
  1351. #define BS_NULL            1
  1352. #define BS_HOLLOW        BS_NULL
  1353. #define BS_HATCHED        2
  1354. #define BS_PATTERN        3
  1355. #define BS_INDEXED        4
  1356. #define    BS_DIBPATTERN        5
  1357.  
  1358. /* Hatch Styles */
  1359. #define HS_HORIZONTAL       0
  1360. #define HS_VERTICAL         1
  1361. #define HS_FDIAGONAL        2
  1362. #define HS_BDIAGONAL        3
  1363. #define HS_CROSS            4
  1364. #define HS_DIAGCROSS        5
  1365.  
  1366. /* Logical Brush (or Pattern) */
  1367. typedef struct tagLOGBRUSH
  1368. {
  1369.     UINT     lbStyle;
  1370.     COLORREF lbColor;
  1371.     int      lbHatch;
  1372. } LOGBRUSH;
  1373. typedef LOGBRUSH*       PLOGBRUSH;
  1374. typedef LOGBRUSH NEAR* NPLOGBRUSH;
  1375. typedef LOGBRUSH FAR*  LPLOGBRUSH;
  1376.  
  1377. typedef LOGBRUSH        PATTERN;
  1378. typedef PATTERN*       PPATTERN;
  1379. typedef PATTERN NEAR* NPPATTERN;
  1380. typedef PATTERN FAR*  LPPATTERN;
  1381.  
  1382. HBRUSH  WINAPI CreateSolidBrush(COLORREF);
  1383. HBRUSH  WINAPI CreateHatchBrush(int, COLORREF);
  1384. HBRUSH  WINAPI CreatePatternBrush(HBITMAP);
  1385. HBRUSH  WINAPI CreateDIBPatternBrush(HGLOBAL, UINT);
  1386. HBRUSH  WINAPI CreateBrushIndirect(LOGBRUSH FAR*);
  1387.  
  1388. /* Stock brushes for use with GetStockObject() */
  1389. #define WHITE_BRUSH        0
  1390. #define LTGRAY_BRUSH        1
  1391. #define GRAY_BRUSH        2
  1392. #define DKGRAY_BRUSH        3
  1393. #define BLACK_BRUSH        4
  1394. #define NULL_BRUSH        5
  1395. #define HOLLOW_BRUSH        NULL_BRUSH
  1396.  
  1397. DWORD   WINAPI SetBrushOrg(HDC, int, int);
  1398. DWORD   WINAPI GetBrushOrg(HDC);
  1399.  
  1400. BOOL    WINAPI GetBrushOrgEx(HDC, POINT FAR*);
  1401. #endif    /* NOGDIOBJ */
  1402.  
  1403. /****** Region support ******************************************************/
  1404.  
  1405. HRGN    WINAPI CreateRectRgn(int, int, int, int);
  1406. HRGN    WINAPI CreateRectRgnIndirect(const RECT FAR*);
  1407. HRGN    WINAPI CreateEllipticRgnIndirect(const RECT FAR*);
  1408. HRGN    WINAPI CreateEllipticRgn(int, int, int, int);
  1409. HRGN    WINAPI CreatePolygonRgn(const POINT FAR*, int, int);
  1410. HRGN    WINAPI CreatePolyPolygonRgn(const POINT FAR*, const int FAR*, int, int);
  1411. HRGN    WINAPI CreateRoundRectRgn(int, int, int, int, int, int);
  1412.  
  1413. /* Region type flags */
  1414. #define ERROR            0
  1415. #define NULLREGION        1
  1416. #define SIMPLEREGION        2
  1417. #define COMPLEXREGION        3
  1418.  
  1419. void    WINAPI SetRectRgn(HRGN, int, int, int, int);
  1420.  
  1421. int     WINAPI CombineRgn(HRGN, HRGN, HRGN, int);
  1422.  
  1423. /* CombineRgn() command values */
  1424. #define RGN_AND         1
  1425. #define RGN_OR            2
  1426. #define RGN_XOR         3
  1427. #define RGN_DIFF        4
  1428. #define RGN_COPY        5
  1429.  
  1430. BOOL    WINAPI EqualRgn(HRGN, HRGN);
  1431. int     WINAPI OffsetRgn(HRGN, int, int);
  1432.  
  1433. int     WINAPI GetRgnBox(HRGN, RECT FAR*);
  1434.  
  1435. #if (WINVER < 0x030a)
  1436. #define RectInRegion RectInRegionOld
  1437. #endif
  1438. BOOL    WINAPI RectInRegion(HRGN, const RECT FAR*);
  1439. BOOL    WINAPI PtInRegion(HRGN, int, int);
  1440.  
  1441. /****** Color palette Support ************************************************/
  1442.  
  1443. #define PALETTERGB(r,g,b)   (0x02000000L | RGB(r,g,b))
  1444. #define PALETTEINDEX(i)     ((COLORREF)(0x01000000L | (DWORD)(WORD)(i)))
  1445.  
  1446. typedef struct tagPALETTEENTRY
  1447. {
  1448.     BYTE    peRed;
  1449.     BYTE    peGreen;
  1450.     BYTE    peBlue;
  1451.     BYTE    peFlags;
  1452. } PALETTEENTRY;
  1453. typedef PALETTEENTRY FAR* LPPALETTEENTRY;
  1454.  
  1455. /* Palette entry flags */
  1456. #define PC_RESERVED    0x01    /* palette index used for animation */
  1457. #define PC_EXPLICIT    0x02    /* palette index is explicit to device */
  1458. #define    PC_NOCOLLAPSE    0x04    /* do not match color to system palette */
  1459.  
  1460. /* Logical Palette */
  1461. typedef struct tagLOGPALETTE
  1462. {
  1463.     WORD    palVersion;
  1464.     WORD    palNumEntries;
  1465.     PALETTEENTRY palPalEntry[1];
  1466. } LOGPALETTE;
  1467. typedef LOGPALETTE*       PLOGPALETTE;
  1468. typedef LOGPALETTE NEAR* NPLOGPALETTE;
  1469. typedef LOGPALETTE FAR*  LPLOGPALETTE;
  1470.  
  1471. HPALETTE WINAPI CreatePalette(const LOGPALETTE FAR*);
  1472.  
  1473. HPALETTE WINAPI SelectPalette(HDC, HPALETTE, BOOL);
  1474.  
  1475. UINT    WINAPI RealizePalette(HDC);
  1476.  
  1477. int     WINAPI UpdateColors(HDC);
  1478. void    WINAPI AnimatePalette(HPALETTE, UINT, UINT, const PALETTEENTRY FAR*);
  1479.  
  1480. UINT    WINAPI SetPaletteEntries(HPALETTE, UINT, UINT, const PALETTEENTRY FAR*);
  1481. UINT    WINAPI GetPaletteEntries(HPALETTE, UINT, UINT, PALETTEENTRY FAR*);
  1482.  
  1483. UINT    WINAPI GetNearestPaletteIndex(HPALETTE, COLORREF);
  1484.  
  1485. BOOL    WINAPI ResizePalette(HPALETTE, UINT);
  1486.  
  1487. UINT    WINAPI GetSystemPaletteEntries(HDC, UINT, UINT, PALETTEENTRY FAR*);
  1488.  
  1489. UINT    WINAPI GetSystemPaletteUse(HDC);
  1490. UINT    WINAPI SetSystemPaletteUse(HDC, UINT);
  1491.  
  1492. /* Get/SetSystemPaletteUse() values */
  1493. #define    SYSPAL_STATIC    1
  1494. #define    SYSPAL_NOSTATIC 2
  1495.  
  1496. /* Palette window messages */
  1497. #define WM_QUERYNEWPALETTE  0x030F
  1498. #define WM_PALETTEISCHANGING 0x0310
  1499. #define WM_PALETTECHANGED   0x0311
  1500.  
  1501. /****** Clipping support *****************************************************/
  1502.  
  1503. int     WINAPI SelectClipRgn(HDC, HRGN);
  1504. int     WINAPI GetClipBox(HDC, RECT FAR*);
  1505.  
  1506. int     WINAPI IntersectClipRect(HDC, int, int, int, int);
  1507. int     WINAPI OffsetClipRgn(HDC, int, int);
  1508. int     WINAPI ExcludeClipRect(HDC, int, int, int, int);
  1509.  
  1510. BOOL    WINAPI PtVisible(HDC, int, int);
  1511. #if (WINVER < 0x030a)
  1512. #define RectVisible RectVisibleOld
  1513. #endif
  1514. BOOL    WINAPI RectVisible(HDC, const RECT FAR*);
  1515.  
  1516.  
  1517.  
  1518. /****** General drawing support ********************************************/
  1519.  
  1520. DWORD   WINAPI MoveTo(HDC, int, int);
  1521. BOOL    WINAPI MoveToEx(HDC, int, int, POINT FAR*);
  1522. DWORD   WINAPI GetCurrentPosition(HDC);
  1523. BOOL    WINAPI GetCurrentPositionEx(HDC, POINT FAR*);
  1524.  
  1525. BOOL    WINAPI LineTo(HDC, int, int);
  1526. BOOL    WINAPI Polyline(HDC, const POINT FAR*, int);
  1527.  
  1528. #ifdef STRICT
  1529. typedef void (CALLBACK* LINEDDAPROC)(int, int, LPARAM);
  1530. #else
  1531. typedef FARPROC LINEDDAPROC;
  1532. #endif
  1533.  
  1534. void    WINAPI LineDDA(int, int, int, int, LINEDDAPROC, LPARAM);
  1535.  
  1536. BOOL    WINAPI Rectangle(HDC, int, int, int, int);
  1537. BOOL    WINAPI RoundRect(HDC, int, int, int, int, int, int);
  1538.  
  1539. BOOL    WINAPI Ellipse(HDC, int, int, int, int);
  1540. BOOL    WINAPI Arc(HDC, int, int, int, int, int, int, int, int);
  1541. BOOL    WINAPI Chord(HDC, int, int, int, int, int, int, int, int);
  1542. BOOL    WINAPI Pie(HDC, int, int, int, int, int, int, int, int);
  1543.  
  1544. BOOL    WINAPI Polygon(HDC, const POINT FAR*, int);
  1545. BOOL    WINAPI PolyPolygon(HDC, const POINT FAR*, int FAR*, int);
  1546.  
  1547. /* PolyFill Modes */
  1548. #define ALTERNATE   1
  1549. #define WINDING     2
  1550.  
  1551. int     WINAPI SetPolyFillMode(HDC, int);
  1552. int     WINAPI GetPolyFillMode(HDC);
  1553.  
  1554. BOOL    WINAPI FloodFill(HDC, int, int, COLORREF);
  1555. BOOL    WINAPI ExtFloodFill(HDC, int, int, COLORREF, UINT);
  1556.  
  1557. /* ExtFloodFill style flags */
  1558. #define  FLOODFILLBORDER   0
  1559. #define  FLOODFILLSURFACE  1
  1560.  
  1561. BOOL    WINAPI FillRgn(HDC, HRGN, HBRUSH);
  1562. BOOL    WINAPI FrameRgn(HDC, HRGN, HBRUSH, int, int);
  1563. BOOL    WINAPI InvertRgn(HDC, HRGN);
  1564. BOOL    WINAPI PaintRgn(HDC, HRGN);
  1565.  
  1566. /* Rectangle output routines */
  1567. int     WINAPI FillRect(HDC, const RECT FAR*, HBRUSH);
  1568. int     WINAPI FrameRect(HDC, const RECT FAR*, HBRUSH);
  1569. void    WINAPI InvertRect(HDC, const RECT FAR*);
  1570.  
  1571. void    WINAPI DrawFocusRect(HDC, const RECT FAR*);
  1572.  
  1573.  
  1574. /****** Text support ********************************************************/
  1575.  
  1576. BOOL    WINAPI TextOut(HDC, int, int, LPCSTR, int);
  1577. LONG    WINAPI TabbedTextOut(HDC, int, int, LPCSTR, int, int, int FAR*, int);
  1578. BOOL    WINAPI ExtTextOut(HDC, int, int, UINT, const RECT FAR*, LPCSTR, UINT, int FAR*);
  1579.  
  1580. #define ETO_GRAYED    0x0001
  1581. #define ETO_OPAQUE    0x0002
  1582. #define ETO_CLIPPED    0x0004
  1583.  
  1584. DWORD   WINAPI GetTextExtent(HDC, LPCSTR, int);
  1585. DWORD   WINAPI GetTabbedTextExtent(HDC, LPCSTR, int, int, int FAR*);
  1586.  
  1587. #if (WINVER >= 0x030a)
  1588. DWORD   WINAPI GetTextExtentEx(HDC, LPCSTR, int, int, int FAR*, int FAR*);
  1589. BOOL    WINAPI GetTextExtentPoint(HDC, LPCSTR, int, SIZE FAR*);
  1590. #endif  /* WINVER >= 0x030a */
  1591.  
  1592. /* DrawText() Format Flags */
  1593. #ifndef NODRAWTEXT
  1594. #define DT_TOP            0x0000
  1595. #define DT_LEFT         0x0000
  1596. #define DT_CENTER        0x0001
  1597. #define DT_RIGHT        0x0002
  1598. #define DT_VCENTER        0x0004
  1599. #define DT_BOTTOM        0x0008
  1600. #define DT_WORDBREAK        0x0010
  1601. #define DT_SINGLELINE        0x0020
  1602. #define DT_EXPANDTABS        0x0040
  1603. #define DT_TABSTOP        0x0080
  1604. #define DT_NOCLIP        0x0100
  1605. #define DT_EXTERNALLEADING  0x0200
  1606. #define DT_CALCRECT        0x0400
  1607. #define DT_NOPREFIX        0x0800
  1608. #define DT_INTERNAL        0x1000
  1609.  
  1610. int     WINAPI DrawText(HDC, LPCSTR, int, RECT FAR*, UINT);
  1611. #endif /* NODRAWTEXT */
  1612.  
  1613. #ifdef STRICT
  1614. typedef BOOL (CALLBACK* GRAYSTRINGPROC)(HDC, LPARAM, int);
  1615. #else
  1616. typedef FARPROC GRAYSTRINGPROC;
  1617. #endif
  1618.  
  1619. BOOL    WINAPI GrayString(HDC, HBRUSH, GRAYSTRINGPROC, LPARAM, int, int, int, int, int);
  1620.  
  1621. BOOL    WINAPI GetCharWidth(HDC, UINT, UINT, int FAR*);
  1622.  
  1623. COLORREF WINAPI SetTextColor(HDC, COLORREF);
  1624. COLORREF WINAPI GetTextColor(HDC);
  1625.  
  1626. COLORREF WINAPI SetBkColor(HDC, COLORREF);
  1627. COLORREF WINAPI GetBkColor(HDC);
  1628.  
  1629. int     WINAPI SetBkMode(HDC, int);
  1630. int     WINAPI GetBkMode(HDC);
  1631.  
  1632. /* Background Modes */
  1633. #define TRANSPARENT     1
  1634. #define OPAQUE          2
  1635. #define TRANSPARENT1    3
  1636.  
  1637. UINT    WINAPI SetTextAlign(HDC, UINT);
  1638. UINT    WINAPI GetTextAlign(HDC);
  1639.  
  1640. /* Text Alignment Options */
  1641. #define TA_NOUPDATECP             0x0000
  1642. #define TA_UPDATECP             0x0001
  1643. #define TA_LEFT              0x0000
  1644. #define TA_RIGHT             0x0002
  1645. #define TA_CENTER             0x0006
  1646. #define TA_TOP                 0x0000
  1647. #define TA_BOTTOM             0x0008
  1648. #define TA_BASELINE             0x0018
  1649.  
  1650. int     WINAPI SetTextCharacterExtra(HDC, int);
  1651. int     WINAPI GetTextCharacterExtra(HDC);
  1652.  
  1653. int     WINAPI SetTextJustification(HDC, int, int);
  1654.  
  1655. /****** Font support ********************************************************/
  1656.  
  1657. #ifndef NOGDIOBJ
  1658. /* Logical Font */
  1659. #define LF_FACESIZE        32
  1660. typedef struct tagLOGFONT
  1661. {
  1662.     int     lfHeight;
  1663.     int     lfWidth;
  1664.     int     lfEscapement;
  1665.     int     lfOrientation;
  1666.     int     lfWeight;
  1667.     BYTE    lfItalic;
  1668.     BYTE    lfUnderline;
  1669.     BYTE    lfStrikeOut;
  1670.     BYTE    lfCharSet;
  1671.     BYTE    lfOutPrecision;
  1672.     BYTE    lfClipPrecision;
  1673.     BYTE    lfQuality;
  1674.     BYTE    lfPitchAndFamily;
  1675.     BYTE    lfFaceName[LF_FACESIZE];
  1676. } LOGFONT;
  1677. typedef LOGFONT*       PLOGFONT;
  1678. typedef LOGFONT NEAR* NPLOGFONT;
  1679. typedef LOGFONT FAR*  LPLOGFONT;
  1680.  
  1681. /* weight values */
  1682. #define FW_DONTCARE        0
  1683. #define FW_THIN         100
  1684. #define FW_EXTRALIGHT        200
  1685. #define FW_LIGHT        300
  1686. #define FW_NORMAL        400
  1687. #define FW_MEDIUM        500
  1688. #define FW_SEMIBOLD        600
  1689. #define FW_BOLD         700
  1690. #define FW_EXTRABOLD        800
  1691. #define FW_HEAVY        900
  1692.  
  1693. #define FW_ULTRALIGHT        FW_EXTRALIGHT
  1694. #define FW_REGULAR        FW_NORMAL
  1695. #define FW_DEMIBOLD        FW_SEMIBOLD
  1696. #define FW_ULTRABOLD        FW_EXTRABOLD
  1697. #define FW_BLACK        FW_HEAVY
  1698.  
  1699. /* CharSet values */
  1700. #define ANSI_CHARSET        0
  1701. #define DEFAULT_CHARSET     1
  1702. #define SYMBOL_CHARSET      2
  1703. #define SHIFTJIS_CHARSET    128
  1704. #define OEM_CHARSET         255
  1705.  
  1706. /* OutPrecision values */
  1707. #define OUT_DEFAULT_PRECIS    0
  1708. #define OUT_STRING_PRECIS    1
  1709. #define OUT_CHARACTER_PRECIS    2
  1710. #define OUT_STROKE_PRECIS    3
  1711. #define OUT_TT_PRECIS        4
  1712. #define OUT_DEVICE_PRECIS    5
  1713. #define OUT_RASTER_PRECIS    6
  1714. #define OUT_TT_ONLY_PRECIS    7
  1715.  
  1716. /* ClipPrecision values */
  1717. #define CLIP_DEFAULT_PRECIS    0
  1718. #define CLIP_CHARACTER_PRECIS    1
  1719. #define CLIP_STROKE_PRECIS    2
  1720. #define CLIP_MASK        0x0F
  1721. #define CLIP_LH_ANGLES        0x10
  1722. #define CLIP_TT_ALWAYS        0x20
  1723. #define CLIP_EMBEDDED        0x80
  1724.  
  1725. /* Quality values */
  1726. #define DEFAULT_QUALITY     0
  1727. #define DRAFT_QUALITY       1
  1728. #define PROOF_QUALITY       2
  1729.  
  1730. /* PitchAndFamily pitch values (low 4 bits) */
  1731. #define DEFAULT_PITCH       0x00
  1732. #define FIXED_PITCH         0x01
  1733. #define VARIABLE_PITCH      0x02
  1734.  
  1735. /* PitchAndFamily family values (high 4 bits) */
  1736. #define FF_DONTCARE         0x00
  1737. #define FF_ROMAN            0x10
  1738. #define FF_SWISS            0x20
  1739. #define FF_MODERN           0x30
  1740. #define FF_SCRIPT           0x40
  1741. #define FF_DECORATIVE       0x50
  1742.  
  1743. HFONT   WINAPI CreateFont(int, int, int, int, int, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, LPCSTR);
  1744. HFONT   WINAPI CreateFontIndirect(const LOGFONT FAR*);
  1745.  
  1746. /* Stock fonts for use with GetStockObject() */
  1747. #define OEM_FIXED_FONT        10
  1748. #define ANSI_FIXED_FONT     11
  1749. #define ANSI_VAR_FONT        12
  1750. #define SYSTEM_FONT        13
  1751. #define DEVICE_DEFAULT_FONT 14
  1752. #define DEFAULT_PALETTE     15
  1753. #define SYSTEM_FIXED_FONT   16
  1754.  
  1755.  
  1756. DWORD   WINAPI SetMapperFlags(HDC, DWORD);
  1757. #define ASPECT_FILTERING         0x00000001L
  1758.  
  1759. int     WINAPI AddFontResource(LPCSTR);
  1760. BOOL    WINAPI RemoveFontResource(LPCSTR);
  1761.  
  1762. #define WM_FONTCHANGE        0x001D
  1763.  
  1764. DWORD   WINAPI GetAspectRatioFilter(HDC);
  1765. #if (WINVER >= 0x030a)
  1766. BOOL    WINAPI GetAspectRatioFilterEx(HDC, SIZE FAR*);
  1767. #endif  /* WINVER >= 0x030a */
  1768. int     WINAPI GetTextFace(HDC, int, LPSTR);
  1769.  
  1770. #endif    /* NOGDIOBJ */
  1771.  
  1772. #ifndef NOSCALABLEFONT
  1773.  
  1774. /*  GDI scalable font WINAPI prototypes and data structures: */
  1775.  
  1776. typedef struct tagPANOSE  /* panose */
  1777. {
  1778.     BYTE    bFamilyType;
  1779.     BYTE    bSerifStyle;
  1780.     BYTE    bWeight;
  1781.     BYTE    bProportion;
  1782.     BYTE    bContrast;
  1783.     BYTE    bStrokeVariation;
  1784.     BYTE    bArmStyle;
  1785.     BYTE    bLetterform;
  1786.     BYTE    bMidline;
  1787.     BYTE    bXHeight;
  1788. } PANOSE;
  1789.  
  1790. #ifndef NOTEXTMETRIC
  1791.  
  1792. typedef struct tagTEXTMETRIC
  1793. {
  1794.     int     tmHeight;
  1795.     int     tmAscent;
  1796.     int     tmDescent;
  1797.     int     tmInternalLeading;
  1798.     int     tmExternalLeading;
  1799.     int     tmAveCharWidth;
  1800.     int     tmMaxCharWidth;
  1801.     int     tmWeight;
  1802.     BYTE    tmItalic;
  1803.     BYTE    tmUnderlined;
  1804.     BYTE    tmStruckOut;
  1805.     BYTE    tmFirstChar;
  1806.     BYTE    tmLastChar;
  1807.     BYTE    tmDefaultChar;
  1808.     BYTE    tmBreakChar;
  1809.     BYTE    tmPitchAndFamily;
  1810.     BYTE    tmCharSet;
  1811.     int     tmOverhang;
  1812.     int     tmDigitizedAspectX;
  1813.     int     tmDigitizedAspectY;
  1814. } TEXTMETRIC;
  1815. typedef TEXTMETRIC*       PTEXTMETRIC;
  1816. typedef TEXTMETRIC NEAR* NPTEXTMETRIC;
  1817. typedef TEXTMETRIC FAR*  LPTEXTMETRIC;
  1818.  
  1819. typedef struct tagNEWTEXTMETRIC
  1820. {
  1821.     int     tmHeight;
  1822.     int     tmAscent;
  1823.     int     tmDescent;
  1824.     int     tmInternalLeading;
  1825.     int     tmExternalLeading;
  1826.     int     tmAveCharWidth;
  1827.     int     tmMaxCharWidth;
  1828.     int     tmWeight;
  1829.     BYTE    tmItalic;
  1830.     BYTE    tmUnderlined;
  1831.     BYTE    tmStruckOut;
  1832.     BYTE    tmFirstChar;
  1833.     BYTE    tmLastChar;
  1834.     BYTE    tmDefaultChar;
  1835.     BYTE    tmBreakChar;
  1836.     BYTE    tmPitchAndFamily;
  1837.     BYTE    tmCharSet;
  1838.     int     tmOverhang;
  1839.     int     tmDigitizedAspectX;
  1840.     int     tmDigitizedAspectY;
  1841.     DWORD   ntmFlags;
  1842.     UINT    ntmSizeEM;
  1843.     UINT    ntmCellHeight;
  1844.     UINT    ntmAvgWidth;
  1845. } NEWTEXTMETRIC;
  1846. typedef NEWTEXTMETRIC*       PNEWTEXTMETRIC;
  1847. typedef NEWTEXTMETRIC NEAR* NPNEWTEXTMETRIC;
  1848. typedef NEWTEXTMETRIC FAR*  LPNEWTEXTMETRIC;
  1849.  
  1850. /* ntmFlags field flags */
  1851. #define NTM_REGULAR    0x00000040L
  1852. #define NTM_BOLD    0x00000020L
  1853. #define NTM_ITALIC    0x00000001L
  1854.  
  1855. typedef struct tagOUTLINETEXTMETRIC
  1856. {
  1857.     UINT    otmSize;
  1858.     TEXTMETRIC otmTextMetrics;
  1859.     BYTE    otmFiller;
  1860.     PANOSE  otmPanoseNumber;
  1861.     UINT    otmfsSelection;
  1862.     UINT    otmfsType;
  1863.     UINT    otmsCharSlopeRise;
  1864.     UINT    otmsCharSlopeRun;
  1865. /*  DWORD   otmItalicAngle; */
  1866.     UINT    otmEMSquare;
  1867.     UINT    otmAscent;
  1868.     UINT    otmDescent;
  1869.     UINT    otmLineGap;
  1870.     UINT    otmsXHeight;
  1871.     UINT    otmsCapEmHeight;
  1872.     RECT    otmrcFontBox;
  1873.     UINT    otmMacAscent;
  1874.     UINT    otmMacDescent;
  1875.     UINT    otmMacLineGap;
  1876.     UINT    otmusMinimumPPEM;
  1877.     POINT   otmptSubscriptSize;
  1878.     POINT   otmptSubscriptOffset;
  1879.     POINT   otmptSuperscriptSize;
  1880.     POINT   otmptSuperscriptOffset;
  1881.     UINT    otmsStrikeoutSize;
  1882.     UINT    otmsStrikeoutPosition;
  1883.     UINT    otmsUnderscoreSize;
  1884.     UINT    otmsUnderscorePosition;
  1885.     PSTR    otmpFamilyName;
  1886.     PSTR    otmpFaceName;
  1887.     PSTR    otmpStyleName;
  1888.     PSTR    otmpFullName;
  1889. } OUTLINETEXTMETRIC;
  1890. typedef OUTLINETEXTMETRIC FAR* LPOUTLINETEXTMETRIC;
  1891.  
  1892. BOOL    WINAPI GetTextMetrics(HDC, LPTEXTMETRIC);
  1893. WORD    WINAPI GetOutlineTextMetrics(HDC, UINT, LPOUTLINETEXTMETRIC);
  1894.  
  1895. #ifdef STRICT
  1896. typedef int (CALLBACK* FONTENUMPROC)(LPLOGFONT, LPTEXTMETRIC, int, LPARAM);
  1897. #else
  1898. typedef FARPROC FONTENUMPROC;
  1899. #endif
  1900.  
  1901. #ifdef STRICT
  1902. int     WINAPI EnumFonts(HDC, LPCSTR, FONTENUMPROC, LPARAM);
  1903. int     WINAPI EnumFontFamilies(HDC, LPCSTR, FONTENUMPROC, LPARAM);
  1904. #else
  1905. int     WINAPI EnumFonts(HDC, LPCSTR, FONTENUMPROC, LPSTR);
  1906. int     WINAPI EnumFontFamilies(HDC, LPCSTR, FONTENUMPROC, LPSTR);
  1907. #endif
  1908.  
  1909. /* EnumFonts font type values */
  1910. #define RASTER_FONTTYPE     0x0001
  1911. #define DEVICE_FONTTYPE     0X0002
  1912. #define TRUETYPE_FONTTYPE   0x0004
  1913.  
  1914. #endif /* NOTEXTMETRIC */
  1915.  
  1916. DWORD   WINAPI GetFontData(HDC, DWORD, DWORD, void FAR*, DWORD);
  1917. BOOL    WINAPI CreateScalableFontResource(UINT, LPCSTR, LPCSTR, LPCSTR);
  1918.  
  1919. typedef struct tagGLYPHMETRICS
  1920. {
  1921.     UINT    gmBlackBoxX;
  1922.     UINT    gmBlackBoxY;
  1923.     POINT   gmptGlyphOrigin;
  1924.     int     gmCellIncX;
  1925.     int     gmCellIncY;
  1926. } GLYPHMETRICS;
  1927. typedef GLYPHMETRICS FAR* LPGLYPHMETRICS;
  1928.  
  1929. typedef struct tagFIXED
  1930. {
  1931.     UINT    fract;
  1932.     int     value;
  1933. } FIXED;
  1934.  
  1935. typedef struct tagMAT2
  1936. {
  1937.     FIXED  eM11;
  1938.     FIXED  eM12;
  1939.     FIXED  eM21;
  1940.     FIXED  eM22;
  1941. } MAT2;
  1942. typedef MAT2 FAR* LPMAT2;
  1943.  
  1944. DWORD   WINAPI GetGlyphOutline(HDC, UINT, UINT, LPGLYPHMETRICS, DWORD, POINT FAR*, LPMAT2);
  1945.  
  1946. /* GetGlyphOutline constants */
  1947. #define GGO_BITMAP         1
  1948. #define GGO_NATIVE         2
  1949.  
  1950. #define TT_POLYGON_TYPE   24
  1951.  
  1952. #define TT_PRIM_LINE       1
  1953. #define TT_PRIM_QSPLINE    2
  1954.  
  1955. typedef struct tagPOINTFX
  1956. {
  1957.     FIXED x;
  1958.     FIXED y;
  1959. } POINTFX, FAR* LPPOINTFX;
  1960.  
  1961. typedef struct tagTTPOLYCURVE
  1962. {
  1963.     UINT    wType;
  1964.     UINT    cpfx;
  1965.     POINTFX apfx[1];
  1966. } TTPOLYCURVE, FAR* LPTTPOLYCURVE;
  1967.  
  1968. typedef struct tagTTPOLYGONHEADER
  1969. {
  1970.     DWORD   cb;
  1971.     DWORD   dwType;
  1972.     POINTFX pfxStart;
  1973. } TTPOLYGONHEADER, FAR* LPTTPOLYGONHEADER;
  1974.  
  1975. typedef UINT FAR* LPFONTDIR;
  1976.  
  1977. typedef struct tagABC
  1978. {
  1979.     int   abcA;
  1980.     UINT  abcB;
  1981.     int   abcC;
  1982. } ABC;
  1983. typedef ABC FAR* LPABC;
  1984.  
  1985. BOOL    WINAPI GetCharABCWidths(HDC, UINT, UINT, LPABC);
  1986.  
  1987. typedef struct tagRASTERIZER_STATUS
  1988. {
  1989.     int   nSize;
  1990.     int   wFlags;
  1991.     int   nLanguageID;
  1992. } RASTERIZER_STATUS;
  1993. typedef RASTERIZER_STATUS FAR* LPRASTERIZER_STATUS;
  1994.  
  1995. /* bits defined in wFlags of RASTERIZER_STATUS */
  1996. #define TT_AVAILABLE    0x0001
  1997. #define TT_ENABLED    0x0002
  1998.  
  1999. BOOL    WINAPI GetRasterizerCaps(LPRASTERIZER_STATUS, int);
  2000.  
  2001. #endif /* NOSCALABLEFONT */
  2002.  
  2003. /****** Bitmap support ******************************************************/
  2004.  
  2005. #ifndef NOBITMAP
  2006. typedef struct tagBITMAP
  2007. {
  2008.     int     bmType;
  2009.     int     bmWidth;
  2010.     int     bmHeight;
  2011.     int     bmWidthBytes;
  2012.     BYTE    bmPlanes;
  2013.     BYTE    bmBitsPixel;
  2014.     void FAR* bmBits;
  2015. } BITMAP;
  2016. typedef BITMAP*       PBITMAP;
  2017. typedef BITMAP NEAR* NPBITMAP;
  2018. typedef BITMAP FAR*  LPBITMAP;
  2019.  
  2020. /* Bitmap Header structures */
  2021. typedef struct tagRGBTRIPLE
  2022. {
  2023.     BYTE    rgbtBlue;
  2024.     BYTE    rgbtGreen;
  2025.     BYTE    rgbtRed;
  2026. } RGBTRIPLE;
  2027. typedef RGBTRIPLE FAR* LPRGBTRIPLE;
  2028.  
  2029. typedef struct tagRGBQUAD
  2030. {
  2031.     BYTE    rgbBlue;
  2032.     BYTE    rgbGreen;
  2033.     BYTE    rgbRed;
  2034.     BYTE    rgbReserved;
  2035. } RGBQUAD;
  2036. typedef RGBQUAD FAR* LPRGBQUAD;
  2037.  
  2038. /* structures for defining DIBs */
  2039. typedef struct tagBITMAPCOREHEADER
  2040. {
  2041.     DWORD   bcSize;
  2042.     short   bcWidth;
  2043.     short   bcHeight;
  2044.     WORD    bcPlanes;
  2045.     WORD    bcBitCount;
  2046. } BITMAPCOREHEADER;
  2047. typedef BITMAPCOREHEADER*      PBITMAPCOREHEADER;
  2048. typedef BITMAPCOREHEADER FAR* LPBITMAPCOREHEADER;
  2049.  
  2050. typedef struct tagBITMAPINFOHEADER
  2051. {
  2052.     DWORD   biSize;
  2053.     LONG    biWidth;
  2054.     LONG    biHeight;
  2055.     WORD    biPlanes;
  2056.     WORD    biBitCount;
  2057.     DWORD   biCompression;
  2058.     DWORD   biSizeImage;
  2059.     LONG    biXPelsPerMeter;
  2060.     LONG    biYPelsPerMeter;
  2061.     DWORD   biClrUsed;
  2062.     DWORD   biClrImportant;
  2063. } BITMAPINFOHEADER;
  2064. typedef BITMAPINFOHEADER*      PBITMAPINFOHEADER;
  2065. typedef BITMAPINFOHEADER FAR* LPBITMAPINFOHEADER;
  2066.  
  2067. /* constants for the biCompression field */
  2068. #define BI_RGB      0L
  2069. #define BI_RLE8     1L
  2070. #define BI_RLE4     2L
  2071.  
  2072. typedef struct tagBITMAPINFO
  2073. {
  2074.     BITMAPINFOHEADER bmiHeader;
  2075.     RGBQUAD         bmiColors[1];
  2076. } BITMAPINFO;
  2077. typedef BITMAPINFO*     PBITMAPINFO;
  2078. typedef BITMAPINFO FAR* LPBITMAPINFO;
  2079.  
  2080. typedef struct tagBITMAPCOREINFO
  2081. {
  2082.     BITMAPCOREHEADER bmciHeader;
  2083.     RGBTRIPLE         bmciColors[1];
  2084. } BITMAPCOREINFO;
  2085. typedef BITMAPCOREINFO*      PBITMAPCOREINFO;
  2086. typedef BITMAPCOREINFO FAR* LPBITMAPCOREINFO;
  2087.  
  2088. typedef struct tagBITMAPFILEHEADER
  2089. {
  2090.     UINT    bfType;
  2091.     DWORD   bfSize;
  2092.     UINT    bfReserved1;
  2093.     UINT    bfReserved2;
  2094.     DWORD   bfOffBits;
  2095. } BITMAPFILEHEADER;
  2096. typedef BITMAPFILEHEADER*      PBITMAPFILEHEADER;
  2097. typedef BITMAPFILEHEADER FAR* LPBITMAPFILEHEADER;
  2098.  
  2099.  
  2100. HBITMAP WINAPI CreateBitmap(int, int, UINT, UINT, const void FAR*);
  2101. HBITMAP WINAPI CreateBitmapIndirect(BITMAP FAR* );
  2102. HBITMAP WINAPI CreateCompatibleBitmap(HDC, int, int);
  2103. HBITMAP WINAPI CreateDiscardableBitmap(HDC, int, int);
  2104. HBITMAP WINAPI CreateDIBitmap(HDC, BITMAPINFOHEADER FAR*, DWORD, const void FAR*, BITMAPINFO FAR*, UINT);
  2105.  
  2106. HBITMAP WINAPI LoadBitmap(HINSTANCE, LPCSTR);
  2107.  
  2108. /* DIB color table identifiers */
  2109. #define DIB_RGB_COLORS  0
  2110. #define DIB_PAL_COLORS  1
  2111.  
  2112. /* constants for CreateDIBitmap */
  2113. #define CBM_INIT        0x00000004L
  2114. #endif    /* NOBITMAP */
  2115.  
  2116. #ifndef NORASTEROPS
  2117.  
  2118. /* Binary raster ops */
  2119. #define R2_BLACK            1
  2120. #define R2_NOTMERGEPEN      2
  2121. #define R2_MASKNOTPEN       3
  2122. #define R2_NOTCOPYPEN       4
  2123. #define R2_MASKPENNOT       5
  2124. #define R2_NOT              6
  2125. #define R2_XORPEN           7
  2126. #define R2_NOTMASKPEN       8
  2127. #define R2_MASKPEN          9
  2128. #define R2_NOTXORPEN        10
  2129. #define R2_NOP              11
  2130. #define R2_MERGENOTPEN      12
  2131. #define R2_COPYPEN          13
  2132. #define R2_MERGEPENNOT      14
  2133. #define R2_MERGEPEN         15
  2134. #define R2_WHITE            16
  2135.  
  2136. /* Ternary raster operations */
  2137. #define SRCCOPY             0x00CC0020L
  2138. #define SRCPAINT            0x00EE0086L
  2139. #define SRCAND              0x008800C6L
  2140. #define SRCINVERT           0x00660046L
  2141. #define SRCERASE            0x00440328L
  2142. #define NOTSRCCOPY          0x00330008L
  2143. #define NOTSRCERASE         0x001100A6L
  2144. #define MERGECOPY           0x00C000CAL
  2145. #define MERGEPAINT          0x00BB0226L
  2146. #define PATCOPY             0x00F00021L
  2147. #define PATPAINT            0x00FB0A09L
  2148. #define PATINVERT           0x005A0049L
  2149. #define DSTINVERT           0x00550009L
  2150. #define BLACKNESS           0x00000042L
  2151. #define WHITENESS           0x00FF0062L
  2152.  
  2153. #endif /* NORASTEROPS */
  2154.  
  2155. #ifndef NOBITMAP
  2156. BOOL    WINAPI BitBlt(HDC, int, int, int, int, HDC, int, int, DWORD);
  2157.  
  2158. BOOL    WINAPI PatBlt(HDC, int, int, int, int, DWORD);
  2159.  
  2160. BOOL    WINAPI StretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD);
  2161. int     WINAPI StretchDIBits(HDC, int, int, int, int, int,
  2162.                         int, int, int, const void FAR*, LPBITMAPINFO, UINT, DWORD);
  2163.  
  2164. COLORREF WINAPI SetPixel(HDC, int, int, COLORREF);
  2165. COLORREF WINAPI GetPixel(HDC, int, int);
  2166.  
  2167. /* StretchBlt() Modes */
  2168. #define BLACKONWHITE    1
  2169. #define WHITEONBLACK    2
  2170. #define COLORONCOLOR    3
  2171.  
  2172. /* new StretchBlt() Modes (simpler names) */
  2173. #define STRETCH_ANDSCANS        1
  2174. #define STRETCH_ORSCANS         2
  2175. #define STRETCH_DELETESCANS     3
  2176.  
  2177. int     WINAPI SetStretchBltMode(HDC, int);
  2178. int     WINAPI GetStretchBltMode(HDC);
  2179.  
  2180. DWORD   WINAPI SetBitmapDimension(HBITMAP, int, int);
  2181. DWORD   WINAPI GetBitmapDimension(HBITMAP);
  2182. #if (WINVER >= 0x030a)
  2183. BOOL    WINAPI SetBitmapDimensionEx(HBITMAP, int, int, SIZE FAR*);
  2184. BOOL    WINAPI GetBitmapDimensionEx(HBITMAP, SIZE FAR*);
  2185. #endif  /* WINVER >= 0x030a */
  2186. int     WINAPI SetROP2(HDC, int);
  2187. int     WINAPI GetROP2(HDC);
  2188.  
  2189. LONG    WINAPI SetBitmapBits(HBITMAP, DWORD, const void FAR*);
  2190. LONG    WINAPI GetBitmapBits(HBITMAP, LONG, void FAR*);
  2191.  
  2192. int     WINAPI SetDIBits(HDC, HBITMAP, UINT, UINT, const void FAR*, BITMAPINFO FAR*, UINT);
  2193. int     WINAPI GetDIBits(HDC, HBITMAP, UINT, UINT, void FAR*, BITMAPINFO FAR*, UINT);
  2194.  
  2195. int     WINAPI SetDIBitsToDevice(HDC, int, int, int, int, int, int, UINT, UINT,
  2196.                     void FAR*, BITMAPINFO FAR*, UINT);
  2197. #endif    /* NOBITMAP */
  2198.  
  2199. /****** Metafile support ****************************************************/
  2200.  
  2201. #ifndef NOMETAFILE
  2202.  
  2203. DECLARE_HANDLE(HMETAFILE);
  2204.  
  2205. HDC     WINAPI CreateMetaFile(LPCSTR);
  2206. HMETAFILE WINAPI CloseMetaFile(HDC);
  2207.  
  2208. HMETAFILE WINAPI GetMetaFile(LPCSTR);
  2209. BOOL      WINAPI DeleteMetaFile(HMETAFILE);
  2210. HMETAFILE WINAPI CopyMetaFile(HMETAFILE, LPCSTR);
  2211.  
  2212. BOOL    WINAPI PlayMetaFile(HDC, HMETAFILE);
  2213.  
  2214. HGLOBAL WINAPI GetMetaFileBits(HMETAFILE);
  2215. HGLOBAL WINAPI SetMetaFileBits(HMETAFILE);
  2216. HGLOBAL WINAPI SetMetaFileBitsBetter(HMETAFILE);
  2217.  
  2218. /* Clipboard Metafile Picture Structure */
  2219. typedef struct tagMETAFILEPICT
  2220. {
  2221.     int     mm;
  2222.     int     xExt;
  2223.     int     yExt;
  2224.     HMETAFILE hMF;
  2225. } METAFILEPICT;
  2226. typedef METAFILEPICT FAR* LPMETAFILEPICT;
  2227.  
  2228. typedef struct tagMETAHEADER
  2229. {
  2230.     UINT    mtType;
  2231.     UINT    mtHeaderSize;
  2232.     UINT    mtVersion;
  2233.     DWORD   mtSize;
  2234.     UINT    mtNoObjects;
  2235.     DWORD   mtMaxRecord;
  2236.     UINT    mtNoParameters;
  2237. } METAHEADER;
  2238.  
  2239. typedef struct tagHANDLETABLE
  2240. {
  2241.     HGDIOBJ objectHandle[1];
  2242. } HANDLETABLE;
  2243. typedef HANDLETABLE*      PHANDLETABLE;
  2244. typedef HANDLETABLE FAR* LPHANDLETABLE;
  2245.  
  2246. typedef struct tagMETARECORD
  2247. {
  2248.     DWORD   rdSize;
  2249.     UINT    rdFunction;
  2250.     UINT    rdParm[1];
  2251. } METARECORD;
  2252. typedef METARECORD*      PMETARECORD;
  2253. typedef METARECORD FAR* LPMETARECORD;
  2254.  
  2255. /* Metafile Functions */
  2256. #define META_SETBKCOLOR             0x0201
  2257. #define META_SETBKMODE             0x0102
  2258. #define META_SETMAPMODE             0x0103
  2259. #define META_SETROP2             0x0104
  2260. #define META_SETRELABS             0x0105
  2261. #define META_SETPOLYFILLMODE         0x0106
  2262. #define META_SETSTRETCHBLTMODE         0x0107
  2263. #define META_SETTEXTCHAREXTRA         0x0108
  2264. #define META_SETTEXTCOLOR         0x0209
  2265. #define META_SETTEXTJUSTIFICATION    0x020A
  2266. #define META_SETWINDOWORG         0x020B
  2267. #define META_SETWINDOWEXT         0x020C
  2268. #define META_SETVIEWPORTORG         0x020D
  2269. #define META_SETVIEWPORTEXT         0x020E
  2270. #define META_OFFSETWINDOWORG         0x020F
  2271. #define META_SCALEWINDOWEXT         0x0410
  2272. #define META_OFFSETVIEWPORTORG         0x0211
  2273. #define META_SCALEVIEWPORTEXT         0x0412
  2274. #define META_LINETO             0x0213
  2275. #define META_MOVETO             0x0214
  2276. #define META_EXCLUDECLIPRECT         0x0415
  2277. #define META_INTERSECTCLIPRECT         0x0416
  2278. #define META_ARC             0x0817
  2279. #define META_ELLIPSE             0x0418
  2280. #define META_FLOODFILL             0x0419
  2281. #define META_PIE             0x081A
  2282. #define META_RECTANGLE             0x041B
  2283. #define META_ROUNDRECT             0x061C
  2284. #define META_PATBLT             0x061D
  2285. #define META_SAVEDC             0x001E
  2286. #define META_SETPIXEL             0x041F
  2287. #define META_OFFSETCLIPRGN         0x0220
  2288. #define META_TEXTOUT             0x0521
  2289. #define META_BITBLT             0x0922
  2290. #define META_STRETCHBLT             0x0B23
  2291. #define META_POLYGON             0x0324
  2292. #define META_POLYLINE             0x0325
  2293. #define META_ESCAPE             0x0626
  2294. #define META_RESTOREDC             0x0127
  2295. #define META_FILLREGION             0x0228
  2296. #define META_FRAMEREGION         0x0429
  2297. #define META_INVERTREGION         0x012A
  2298. #define META_PAINTREGION         0x012B
  2299. #define META_SELECTCLIPREGION         0x012C
  2300. #define META_SELECTOBJECT         0x012D
  2301. #define META_SETTEXTALIGN         0x012E
  2302. #define META_DRAWTEXT             0x062F
  2303.  
  2304. #define    META_CHORD             0x0830
  2305. #define    META_SETMAPPERFLAGS         0x0231
  2306. #define    META_EXTTEXTOUT             0x0a32 
  2307. #define    META_SETDIBTODEV         0x0d33
  2308. #define    META_SELECTPALETTE         0x0234
  2309. #define    META_REALIZEPALETTE         0x0035
  2310. #define    META_ANIMATEPALETTE         0x0436
  2311. #define    META_SETPALENTRIES         0x0037
  2312. #define    META_POLYPOLYGON         0x0538
  2313. #define    META_RESIZEPALETTE         0x0139
  2314.  
  2315. #define    META_DIBBITBLT             0x0940
  2316. #define    META_DIBSTRETCHBLT         0x0b41
  2317. #define    META_DIBCREATEPATTERNBRUSH   0x0142
  2318. #define    META_STRETCHDIB             0x0f43
  2319.  
  2320. #define META_EXTFLOODFILL         0x0548
  2321.  
  2322. #define META_RESETDC             0x014C
  2323. #define META_STARTDOC             0x014D
  2324. #define META_STARTPAGE             0x004F
  2325. #define META_ENDPAGE             0x0050
  2326. #define META_ABORTDOC             0x0052
  2327. #define META_ENDDOC             0x005E
  2328.  
  2329. #define    META_DELETEOBJECT         0x01f0
  2330.  
  2331. #define    META_CREATEPALETTE         0x00f7
  2332. #define META_CREATEBRUSH         0x00F8
  2333. #define META_CREATEPATTERNBRUSH         0x01F9
  2334. #define META_CREATEPENINDIRECT         0x02FA
  2335. #define META_CREATEFONTINDIRECT         0x02FB
  2336. #define META_CREATEBRUSHINDIRECT     0x02FC
  2337. #define META_CREATEBITMAPINDIRECT    0x02FD
  2338. #define META_CREATEBITMAP         0x06FE
  2339. #define META_CREATEREGION         0x06FF
  2340.  
  2341. void    WINAPI PlayMetaFileRecord(HDC, HANDLETABLE FAR*, METARECORD FAR*, UINT);
  2342.  
  2343. #ifdef STRICT
  2344. typedef int (CALLBACK* MFENUMPROC)(HDC, HANDLETABLE FAR*, METARECORD FAR*, int, LPARAM);
  2345. #else
  2346. typedef FARPROC MFENUMPROC;
  2347. #endif
  2348.  
  2349. BOOL    WINAPI EnumMetaFile(HDC, HLOCAL, MFENUMPROC, LPARAM);
  2350.  
  2351. #endif /* NOMETAFILE */
  2352.  
  2353. /****** Printing support ****************************************************/
  2354.  
  2355. typedef struct
  2356. {
  2357.     int     cbSize;
  2358.     LPCSTR  lpszDocName;
  2359.     LPCSTR  lpszOutput;
  2360. }   DOCINFO;
  2361. typedef DOCINFO FAR* LPDOCINFO;
  2362.  
  2363. int     WINAPI StartDoc(HDC, DOCINFO FAR*);
  2364. int     WINAPI StartPage(HDC);
  2365. int     WINAPI EndPage(HDC);
  2366. int     WINAPI EndDoc(HDC);
  2367. int     WINAPI AbortDoc(HDC);
  2368.  
  2369. #ifdef STRICT
  2370. typedef BOOL (CALLBACK* ABORTPROC)(HDC, int);
  2371. #else
  2372. typedef FARPROC ABORTPROC;
  2373. #endif
  2374.  
  2375. int     WINAPI SetAbortProc(HDC, ABORTPROC);
  2376.  
  2377. HANDLE  WINAPI SpoolFile(LPSTR, LPSTR, LPSTR, LPSTR);
  2378. BOOL    WINAPI QueryAbort(HDC, int);
  2379.  
  2380. /* Spooler Error Codes */
  2381. #define SP_NOTREPORTED             0x4000
  2382. #define SP_ERROR             (-1)
  2383. #define SP_APPABORT             (-2)
  2384. #define SP_USERABORT             (-3)
  2385. #define SP_OUTOFDISK             (-4)
  2386. #define SP_OUTOFMEMORY             (-5)
  2387.  
  2388. #define PR_JOBSTATUS             0x0000
  2389.  
  2390. #endif   /* NOGDI  */
  2391.  
  2392. /* Spooler status notification message */
  2393. #define WM_SPOOLERSTATUS        0x002A
  2394.  
  2395. #ifndef NOGDI
  2396.  
  2397. /******* GDI Escape support *************************************************/
  2398.  
  2399. int     WINAPI Escape(HDC, int, int, LPCSTR, void FAR*);
  2400.  
  2401. /* GDI Escapes */
  2402. #define NEWFRAME             1
  2403. #define ABORTDOC             2
  2404. #define NEXTBAND             3
  2405. #define SETCOLORTABLE             4
  2406. #define GETCOLORTABLE             5
  2407. #define FLUSHOUTPUT             6
  2408. #define DRAFTMODE             7
  2409. #define QUERYESCSUPPORT          8
  2410. #define SETABORTPROC             9
  2411. #define STARTDOC             10
  2412. #define ENDDOC                 11
  2413. #define GETPHYSPAGESIZE          12
  2414. #define GETPRINTINGOFFSET         13
  2415. #define GETSCALINGFACTOR         14
  2416. #define MFCOMMENT             15
  2417. #define GETPENWIDTH             16
  2418. #define SETCOPYCOUNT             17
  2419. #define SELECTPAPERSOURCE         18
  2420. #define DEVICEDATA             19
  2421. #define PASSTHROUGH             19
  2422. #define GETTECHNOLGY             20
  2423. #define GETTECHNOLOGY             20
  2424. #define SETENDCAP             21
  2425. #define SETLINEJOIN             22
  2426. #define SETMITERLIMIT             23
  2427. #define BANDINFO             24
  2428. #define DRAWPATTERNRECT          25
  2429. #define GETVECTORPENSIZE         26
  2430. #define GETVECTORBRUSHSIZE         27
  2431. #define ENABLEDUPLEX             28
  2432. #define GETSETPAPERBINS          29
  2433. #define GETSETPRINTORIENT         30
  2434. #define ENUMPAPERBINS             31
  2435. #define SETDIBSCALING             32
  2436. #define EPSPRINTING                 33
  2437. #define ENUMPAPERMETRICS            34
  2438. #define GETSETPAPERMETRICS          35
  2439. #define POSTSCRIPT_DATA             37
  2440. #define POSTSCRIPT_IGNORE         38
  2441. #define MOUSETRAILS             39
  2442.  
  2443. #define GETEXTENDEDTEXTMETRICS         256
  2444. #define GETEXTENTTABLE             257
  2445. #define GETPAIRKERNTABLE         258
  2446. #define GETTRACKKERNTABLE         259
  2447. #define EXTTEXTOUT             512
  2448. #define ENABLERELATIVEWIDTHS         768
  2449. #define ENABLEPAIRKERNING         769
  2450. #define SETKERNTRACK             770
  2451. #define SETALLJUSTVALUES         771
  2452. #define SETCHARSET             772
  2453.  
  2454. #define STRETCHBLT             2048
  2455.  
  2456. #define GETSETSCREENPARAMS           3072
  2457.  
  2458. #define BEGIN_PATH             4096
  2459. #define CLIP_TO_PATH             4097
  2460. #define END_PATH             4098
  2461. #define EXT_DEVICE_CAPS             4099
  2462. #define RESTORE_CTM             4100
  2463. #define SAVE_CTM                 4101
  2464. #define SET_ARC_DIRECTION         4102
  2465. #define SET_BACKGROUND_COLOR         4103
  2466. #define SET_POLY_MODE             4104
  2467. #define SET_SCREEN_ANGLE         4105
  2468. #define SET_SPREAD             4106
  2469. #define TRANSFORM_CTM             4107
  2470. #define SET_CLIP_BOX             4108
  2471. #define SET_BOUNDS                   4109
  2472.  
  2473. #endif /* NOGDI */
  2474.  
  2475. /****** USER typedefs, structures, and functions *****************************/
  2476.  
  2477. DECLARE_HANDLE(HWND);
  2478.  
  2479. #ifndef NOUSER
  2480.  
  2481. DECLARE_HANDLE(HMENU);
  2482.  
  2483. DECLARE_HANDLE(HICON);
  2484. typedef HICON HCURSOR;        /* HICONs & HCURSORs are polymorphic */
  2485.  
  2486. /****** System Metrics *******************************************************/
  2487.  
  2488. #ifndef NOSYSMETRICS
  2489.  
  2490. int WINAPI GetSystemMetrics(int);
  2491.  
  2492. /* GetSystemMetrics() codes */
  2493. #define SM_CXSCREEN         0
  2494. #define SM_CYSCREEN         1
  2495. #define SM_CXVSCROLL         2
  2496. #define SM_CYHSCROLL         3
  2497. #define SM_CYCAPTION         4
  2498. #define SM_CXBORDER         5
  2499. #define SM_CYBORDER         6
  2500. #define SM_CXDLGFRAME         7
  2501. #define SM_CYDLGFRAME         8
  2502. #define SM_CYVTHUMB         9
  2503. #define SM_CXHTHUMB         10
  2504. #define SM_CXICON         11
  2505. #define SM_CYICON         12
  2506. #define SM_CXCURSOR         13
  2507. #define SM_CYCURSOR         14
  2508. #define SM_CYMENU         15
  2509. #define SM_CXFULLSCREEN      16
  2510. #define SM_CYFULLSCREEN      17
  2511. #define SM_CYKANJIWINDOW     18
  2512. #define SM_MOUSEPRESENT      19
  2513. #define SM_CYVSCROLL         20
  2514. #define SM_CXHSCROLL         21
  2515. #define SM_DEBUG         22
  2516. #define SM_SWAPBUTTON         23
  2517. #define SM_RESERVED1         24
  2518. #define SM_RESERVED2         25
  2519. #define SM_RESERVED3         26
  2520. #define SM_RESERVED4         27
  2521. #define SM_CXMIN         28
  2522. #define SM_CYMIN         29
  2523. #define SM_CXSIZE         30
  2524. #define SM_CYSIZE         31
  2525. #define SM_CXFRAME         32
  2526. #define SM_CYFRAME         33
  2527. #define SM_CXMINTRACK         34
  2528. #define SM_CYMINTRACK         35
  2529.  
  2530. #if (WINVER >= 0x030a)
  2531. #define SM_CXDOUBLECLK       36
  2532. #define SM_CYDOUBLECLK       37
  2533. #define SM_CXICONSPACING     38
  2534. #define SM_CYICONSPACING     39
  2535. #define SM_MENUDROPALIGNMENT 40
  2536. #define SM_PENWINDOWS        41
  2537. #define SM_DBCSENABLED       42
  2538. #endif /* WINVER >= 0x030a */
  2539.  
  2540. #define SM_CMETRICS         43
  2541.  
  2542. #endif /* NOSYSMETRICS */
  2543.  
  2544. UINT    WINAPI GetDoubleClickTime(void);
  2545. void    WINAPI SetDoubleClickTime(UINT);
  2546.  
  2547. #define WM_DEVMODECHANGE    0x001B
  2548. #define WM_TIMECHANGE        0x001E
  2549.  
  2550. /****** System Parameters support ********************************************/
  2551.  
  2552. #if (WINVER >= 0x030a)
  2553. #ifndef NOSYSTEMPARAMSINFO
  2554.  
  2555. BOOL    WINAPI SystemParametersInfo(UINT, UINT, VOID FAR*, UINT);
  2556.  
  2557. #define SPI_GETBEEP            1
  2558. #define SPI_SETBEEP            2
  2559. #define SPI_GETMOUSE            3
  2560. #define SPI_SETMOUSE            4
  2561. #define SPI_GETBORDER            5
  2562. #define SPI_SETBORDER            6
  2563. #define SPI_GETKEYBOARDSPEED        10
  2564. #define SPI_SETKEYBOARDSPEED        11
  2565. #define SPI_LANGDRIVER            12
  2566. #define SPI_ICONHORIZONTALSPACING   13
  2567. #define SPI_GETSCREENSAVETIMEOUT    14
  2568. #define SPI_SETSCREENSAVETIMEOUT    15
  2569. #define SPI_GETSCREENSAVEACTIVE     16
  2570. #define SPI_SETSCREENSAVEACTIVE     17
  2571. #define SPI_GETGRIDGRANULARITY        18
  2572. #define SPI_SETGRIDGRANULARITY        19
  2573. #define SPI_SETDESKWALLPAPER        20
  2574. #define SPI_SETDESKPATTERN        21
  2575. #define SPI_GETKEYBOARDDELAY        22
  2576. #define SPI_SETKEYBOARDDELAY        23
  2577. #define SPI_ICONVERTICALSPACING     24
  2578. #define SPI_GETICONTITLEWRAP        25
  2579. #define SPI_SETICONTITLEWRAP        26
  2580. #define SPI_GETMENUDROPALIGNMENT    27
  2581. #define SPI_SETMENUDROPALIGNMENT    28
  2582. #define SPI_SETDOUBLECLKWIDTH        29
  2583. #define SPI_SETDOUBLECLKHEIGHT        30
  2584. #define SPI_GETICONTITLELOGFONT     31
  2585. #define SPI_SETDOUBLECLICKTIME        32
  2586. #define SPI_SETMOUSEBUTTONSWAP        33
  2587. #define SPI_SETICONTITLELOGFONT     34
  2588. #define SPI_GETFASTTASKSWITCH       35
  2589. #define SPI_SETFASTTASKSWITCH       36
  2590.  
  2591. /* SystemParametersInfo flags */
  2592. #define SPIF_UPDATEINIFILE        0x0001
  2593. #define SPIF_SENDWININICHANGE        0x0002
  2594.  
  2595. #endif  /* NOSYSTEMPARAMSINFO  */
  2596. #endif  /* WINVER >= 0x030a */
  2597.  
  2598. /****** Rectangle support ****************************************************/
  2599.  
  2600. void    WINAPI SetRect(RECT FAR*, int, int, int, int);
  2601. void    WINAPI SetRectEmpty(RECT FAR*);
  2602.  
  2603. void    WINAPI CopyRect(RECT FAR*, const RECT FAR*);
  2604.  
  2605. BOOL    WINAPI IsRectEmpty(const RECT FAR*);
  2606.  
  2607. BOOL    WINAPI EqualRect(const RECT FAR*, const RECT FAR*);
  2608.  
  2609. BOOL    WINAPI IntersectRect(RECT FAR*, const RECT FAR*, const RECT FAR*);
  2610. BOOL    WINAPI UnionRect(RECT FAR*, const RECT FAR*, const RECT FAR*);
  2611. BOOL    WINAPI SubtractRect(RECT FAR*, const RECT FAR*, const RECT FAR*);
  2612.  
  2613. void    WINAPI OffsetRect(RECT FAR*, int, int);
  2614. void    WINAPI InflateRect(RECT FAR*, int, int);
  2615.  
  2616. BOOL    WINAPI PtInRect(const RECT FAR*, POINT);
  2617.  
  2618. /****** Window message support ***********************************************/
  2619.  
  2620. UINT WINAPI RegisterWindowMessage(LPCSTR);
  2621.  
  2622. #define WM_NULL            0x0000
  2623.  
  2624. /* NOTE: All messages below 0x0400 are RESERVED by Windows */
  2625. #define WM_USER            0x0400
  2626.  
  2627. #ifndef NOMSG
  2628.  
  2629. /* Queued message structure */
  2630. typedef struct tagMSG
  2631. {
  2632.     HWND    hwnd;
  2633.     UINT        message;
  2634.     WPARAM    wParam;
  2635.     LPARAM    lParam;
  2636.     DWORD       time;
  2637.     POINT    pt;
  2638. } MSG;
  2639. typedef MSG* PMSG;
  2640. typedef MSG NEAR* NPMSG;
  2641. typedef MSG FAR* LPMSG;
  2642.  
  2643. BOOL    WINAPI GetMessage(MSG FAR*, HWND, UINT, UINT);
  2644. BOOL    WINAPI PeekMessage(MSG FAR*, HWND, UINT, UINT, UINT);
  2645.  
  2646. /* PeekMessage() options */
  2647. #define PM_NOREMOVE    0x0000
  2648. #define PM_REMOVE    0x0001
  2649. #define PM_NOYIELD    0x0002
  2650.  
  2651. void    WINAPI WaitMessage(void);
  2652.  
  2653. DWORD   WINAPI GetMessagePos(void);
  2654. LONG    WINAPI GetMessageTime(void);
  2655. #if (WINVER >= 0x030a)
  2656. LONG    WINAPI GetMessageExtraInfo(void);
  2657. #endif /* WINVER >= 0x030a */
  2658.  
  2659. BOOL    WINAPI TranslateMessage(const MSG FAR*);
  2660. LONG    WINAPI DispatchMessage(const MSG FAR*);
  2661.  
  2662. BOOL    WINAPI SetMessageQueue(int);
  2663.  
  2664. BOOL    WINAPI GetInputState(void);
  2665.  
  2666. #if (WINVER >= 0x030a)
  2667. DWORD   WINAPI GetQueueStatus(UINT flags);
  2668.  
  2669. /* GetQueueStatus flags */
  2670. #define QS_KEY        0x0001
  2671. #define QS_MOUSEMOVE    0x0002
  2672. #define QS_MOUSEBUTTON    0x0004
  2673. #define QS_MOUSE    (QS_MOUSEMOVE | QS_MOUSEBUTTON)
  2674. #define QS_POSTMESSAGE    0x0008
  2675. #define QS_TIMER    0x0010
  2676. #define QS_PAINT    0x0020
  2677. #define QS_SENDMESSAGE    0x0040
  2678.  
  2679. #define QS_ALLINPUT     0x007f
  2680. #endif  /* WINVER >= 0x030a */
  2681.  
  2682. #endif   /* NOMSG */
  2683.  
  2684. BOOL    WINAPI PostMessage(HWND, UINT, WPARAM, LPARAM);
  2685. LRESULT WINAPI SendMessage(HWND, UINT, WPARAM, LPARAM);
  2686.  
  2687. #ifndef NOMSG
  2688.  
  2689. BOOL    WINAPI PostAppMessage(HTASK, UINT, WPARAM, LPARAM);
  2690.  
  2691. void    WINAPI ReplyMessage(LRESULT);
  2692. BOOL    WINAPI InSendMessage(void);
  2693.  
  2694. /* Special HWND value for use with PostMessage() and SendMessage() */
  2695. #define HWND_BROADCAST    ((HWND)0xffff)
  2696.  
  2697. BOOL WINAPI CallMsgFilter(MSG FAR*, int);
  2698.  
  2699. #define WH_GETMESSAGE        3
  2700.  
  2701. #define WH_CALLWNDPROC        4
  2702.  
  2703. #define WH_MSGFILTER        (-1)
  2704. #define WH_SYSMSGFILTER        6
  2705.  
  2706. /* CallMsgFilter() and WH_SYS/MSGFILTER context codes */
  2707. #define MSGF_DIALOGBOX         0
  2708. #define MSGF_MENU         2
  2709. #define MSGF_MOVE         3
  2710. #define MSGF_SIZE         4
  2711. #define MSGF_SCROLLBAR         5
  2712. #define MSGF_NEXTWINDOW      6
  2713. #define MSGF_MAINLOOP            8
  2714. #define MSGF_USER                4096
  2715. #endif /* NOMSG */
  2716.  
  2717. /* Standard window messages */
  2718. /* PenWindows specific messages */
  2719. #define WM_PENWINFIRST        0x0380
  2720. #define WM_PENWINLAST        0x038F
  2721.  
  2722. /* Coalescing messages */
  2723. #define WM_COALESCE_FIRST   0x0390
  2724. #define WM_COALESCE_LAST    0x039F
  2725.  
  2726.  
  2727. #if (WINVER >= 0x030a)
  2728. /****** Power management ****************************************************/
  2729. #define WM_POWER        0x0048
  2730.  
  2731. /* wParam for WM_POWER window message and DRV_POWER driver notification */
  2732. #define PWR_OK              1
  2733. #define PWR_FAIL            (-1)
  2734. #define PWR_SUSPENDREQUEST  1
  2735. #define PWR_SUSPENDRESUME   2
  2736. #define PWR_CRITIALRESUME   3
  2737. #endif  /* WINVER >= 0x030a */
  2738.  
  2739. /****** Application termination *********************************************/
  2740.  
  2741. #define WM_QUERYENDSESSION  0x0011
  2742. #define WM_ENDSESSION        0x0016
  2743.  
  2744. #define WM_QUIT            0x0012
  2745.  
  2746. void    WINAPI PostQuitMessage(int);
  2747.  
  2748. #define WM_SYSTEMERROR        0x0017
  2749.  
  2750. /****** Window class management *********************************************/
  2751.  
  2752. #ifdef STRICT
  2753. typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
  2754. #else
  2755. typedef FARPROC WNDPROC;
  2756. #endif
  2757.  
  2758. typedef struct tagWNDCLASS
  2759. {
  2760.     UINT        style;
  2761. #ifdef STRICT
  2762.     WNDPROC    lpfnWndProc;
  2763. #else
  2764.     LRESULT     (CALLBACK* lpfnWndProc)();
  2765. #endif
  2766.     int         cbClsExtra;
  2767.     int         cbWndExtra;
  2768.     HINSTANCE    hInstance;
  2769.     HICON    hIcon;
  2770.     HCURSOR    hCursor;
  2771.     HBRUSH    hbrBackground;
  2772.     LPCSTR    lpszMenuName;
  2773.     LPCSTR    lpszClassName;
  2774. } WNDCLASS;
  2775. typedef WNDCLASS* PWNDCLASS;
  2776. typedef WNDCLASS NEAR* NPWNDCLASS;
  2777. typedef WNDCLASS FAR* LPWNDCLASS;
  2778.  
  2779. ATOM    WINAPI RegisterClass(const WNDCLASS FAR*);
  2780. BOOL    WINAPI UnregisterClass(LPCSTR, HINSTANCE);
  2781.  
  2782. BOOL    WINAPI GetClassInfo(HINSTANCE, LPCSTR, WNDCLASS FAR*);
  2783. int     WINAPI GetClassName(HWND, LPSTR, int);
  2784.  
  2785. #ifndef NOWINSTYLES
  2786.  
  2787. /* Class styles */
  2788. #define CS_VREDRAW        0x0001
  2789. #define CS_HREDRAW        0x0002
  2790.  
  2791. #define CS_OWNDC        0x0020
  2792. #define CS_CLASSDC        0x0040
  2793. #define CS_PARENTDC        0x0080
  2794.  
  2795. #define CS_SAVEBITS        0x0800
  2796.  
  2797. #define CS_DBLCLKS        0x0008
  2798.  
  2799. #define CS_BYTEALIGNCLIENT  0x1000
  2800. #define CS_BYTEALIGNWINDOW  0x2000
  2801.  
  2802. #define CS_NOCLOSE        0x0200
  2803.  
  2804. #define CS_KEYCVTWINDOW     0x0004
  2805. #define CS_NOKEYCVT        0x0100
  2806.  
  2807. #define CS_GLOBALCLASS        0x4000
  2808. #endif    /* NOWINSTYLES */
  2809.  
  2810. #ifndef NOWINOFFSETS
  2811.  
  2812. #ifdef STRICT
  2813. WPARAM  WINAPI GetClassWord(HWND, int);
  2814. WPARAM  WINAPI SetClassWord(HWND, int, WPARAM);
  2815. LPARAM  WINAPI GetClassLong(HWND, int);
  2816. LPARAM  WINAPI SetClassLong(HWND, int, LPARAM);
  2817. #else
  2818. UINT    WINAPI GetClassWord(HWND, int);
  2819. UINT    WINAPI SetClassWord(HWND, int, UINT);
  2820. LONG    WINAPI GetClassLong(HWND, int);
  2821. LONG    WINAPI SetClassLong(HWND, int, LONG);
  2822. #endif
  2823.  
  2824. /* Class field offsets for GetClassLong() and GetClassWord() */
  2825. #define GCL_MENUNAME        (-8)
  2826. #define GCW_HBRBACKGROUND   (-10)
  2827. #define GCW_HCURSOR        (-12)
  2828. #define GCW_HICON        (-14)
  2829. #define GCW_HMODULE        (-16)
  2830. #define GCW_CBWNDEXTRA        (-18)
  2831. #define GCW_CBCLSEXTRA        (-20)
  2832. #define GCL_WNDPROC        (-24)
  2833. #define GCW_STYLE        (-26)
  2834.  
  2835. #if (WINVER >= 0x030a)
  2836. #define GCW_ATOM            (-32)
  2837. #endif
  2838.  
  2839. #endif    /* NOWINOFFSETS */
  2840.  
  2841. /****** Window creation/destroy *********************************************/
  2842.  
  2843. /* Window Styles */
  2844. #ifndef NOWINSTYLES
  2845.  
  2846. /* Basic window types */
  2847. #define WS_OVERLAPPED        0x00000000L
  2848. #define WS_POPUP        0x80000000L
  2849. #define WS_CHILD        0x40000000L
  2850.  
  2851. /* Clipping styles */
  2852. #define WS_CLIPSIBLINGS     0x04000000L
  2853. #define WS_CLIPCHILDREN     0x02000000L
  2854.  
  2855. /* Generic window states */
  2856. #define WS_VISIBLE        0x10000000L
  2857. #define WS_DISABLED        0x08000000L
  2858.  
  2859. /* Main window states */
  2860. #define WS_MINIMIZE        0x20000000L
  2861. #define WS_MAXIMIZE        0x01000000L
  2862.  
  2863. /* Main window styles */
  2864. #define WS_CAPTION        0x00C00000L     /* WS_BORDER | WS_DLGFRAME    */
  2865. #define WS_BORDER        0x00800000L
  2866. #define WS_DLGFRAME        0x00400000L
  2867. #define WS_VSCROLL        0x00200000L
  2868. #define WS_HSCROLL        0x00100000L
  2869. #define WS_SYSMENU        0x00080000L
  2870. #define WS_THICKFRAME        0x00040000L
  2871. #define WS_MINIMIZEBOX        0x00020000L
  2872. #define WS_MAXIMIZEBOX        0x00010000L
  2873.  
  2874. /* Control window styles */
  2875. #define WS_GROUP        0x00020000L
  2876. #define WS_TABSTOP        0x00010000L
  2877.  
  2878. /* Common Window Styles */
  2879. #define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
  2880. #define WS_POPUPWINDOW        (WS_POPUP | WS_BORDER | WS_SYSMENU)
  2881. #define WS_CHILDWINDOW        (WS_CHILD)
  2882.  
  2883. /* Extended Window Styles */
  2884. #define WS_EX_DLGMODALFRAME  0x00000001L
  2885. #define WS_EX_NOPARENTNOTIFY 0x00000004L
  2886.  
  2887. #if (WINVER >= 0x030a)
  2888. #define WS_EX_TOPMOST         0x00000008L
  2889. #define WS_EX_ACCEPTFILES    0x00000010L
  2890. #define WS_EX_TRANSPARENT    0x00000020L
  2891. #endif /* WINVER >= 0x030a */
  2892.  
  2893. /* Obsolete style names */
  2894. #define WS_TILED        WS_OVERLAPPED
  2895. #define WS_ICONIC        WS_MINIMIZE
  2896. #define WS_SIZEBOX        WS_THICKFRAME
  2897. #define WS_TILEDWINDOW        WS_OVERLAPPEDWINDOW
  2898.  
  2899.  
  2900. #endif /* NOWINSTYLES */
  2901.  
  2902. /* Special value for CreateWindow, et al. */
  2903. #define HWND_DESKTOP        ((HWND)NULL)
  2904.  
  2905. BOOL    WINAPI IsWindow(HWND);
  2906.  
  2907. HWND    WINAPI CreateWindowEx(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, void FAR*);
  2908. HWND    WINAPI CreateWindow(LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, void FAR*);
  2909.  
  2910. #define WM_CREATE        0x0001
  2911. #define WM_NCCREATE        0x0081
  2912.  
  2913. /* WM_CREATE/WM_NCCREATE lParam struct */
  2914. typedef struct tagCREATESTRUCT
  2915. {
  2916.     void FAR* lpCreateParams;
  2917.     HINSTANCE hInstance;
  2918.     HMENU     hMenu;
  2919.     HWND      hwndParent;
  2920.     int       cy;
  2921.     int       cx;
  2922.     int       y;
  2923.     int       x;
  2924.     LONG      style;
  2925.     LPCSTR    lpszName;
  2926.     LPCSTR    lpszClass;
  2927.     DWORD     dwExStyle;
  2928. } CREATESTRUCT;
  2929. typedef CREATESTRUCT FAR* LPCREATESTRUCT;
  2930.  
  2931. BOOL    WINAPI DestroyWindow(HWND);
  2932.  
  2933. #define WM_DESTROY        0x0002
  2934. #define WM_NCDESTROY        0x0082
  2935.  
  2936. /* Basic window attributes */
  2937.  
  2938. HTASK   WINAPI GetWindowTask(HWND);
  2939.  
  2940. BOOL    WINAPI IsChild(HWND, HWND);
  2941.  
  2942. HWND    WINAPI GetParent(HWND);
  2943. HWND    WINAPI SetParent(HWND, HWND);
  2944.  
  2945. BOOL    WINAPI IsWindowVisible(HWND);
  2946.  
  2947. BOOL    WINAPI ShowWindow(HWND, int);
  2948.  
  2949.  
  2950. #ifndef NOSHOWWINDOW
  2951.  
  2952. #define SW_HIDE            0
  2953. #define SW_SHOWNORMAL        1
  2954. #define SW_NORMAL        1
  2955. #define SW_SHOWMINIMIZED    2
  2956. #define SW_SHOWMAXIMIZED    3
  2957. #define SW_MAXIMIZE        3
  2958. #define SW_SHOWNOACTIVATE   4
  2959. #define SW_SHOW            5
  2960. #define SW_MINIMIZE        6
  2961. #define SW_SHOWMINNOACTIVE  7
  2962. #define SW_SHOWNA        8
  2963. #define SW_RESTORE          9
  2964.  
  2965. /* Obsolete ShowWindow() command names */
  2966. #define HIDE_WINDOW        0
  2967. #define SHOW_OPENWINDOW     1
  2968. #define SHOW_ICONWINDOW     2
  2969. #define SHOW_FULLSCREEN     3
  2970. #define SHOW_OPENNOACTIVATE 4
  2971.  
  2972. #define WM_SHOWWINDOW        0x0018
  2973.  
  2974. /* WM_SHOWWINDOW wParam codes */
  2975. #define SW_PARENTCLOSING    1
  2976. #define SW_OTHERMAXIMIZED   2
  2977. #define SW_PARENTOPENING    3
  2978. #define SW_OTHERRESTORED    4
  2979.  
  2980. /* Obsolete constant names */
  2981. #define SW_OTHERZOOM        SW_OTHERMAXIMIZED
  2982. #define SW_OTHERUNZOOM        SW_OTHERRESTORED
  2983. #endif    /* NOSHOWWINDOW */
  2984.  
  2985. #define WM_SETREDRAW        0x000B
  2986.  
  2987. /* Enabled state */
  2988. BOOL    WINAPI EnableWindow(HWND,BOOL);
  2989. BOOL    WINAPI IsWindowEnabled(HWND);
  2990.  
  2991. #define WM_ENABLE        0x000A
  2992.  
  2993. /* Window text */
  2994. void    WINAPI SetWindowText(HWND, LPCSTR);
  2995. int     WINAPI GetWindowText(HWND, LPSTR, int);
  2996. int     WINAPI GetWindowTextLength(HWND);
  2997.  
  2998. #define WM_SETTEXT        0x000C
  2999. #define WM_GETTEXT        0x000D
  3000. #define WM_GETTEXTLENGTH    0x000E
  3001.  
  3002. /* Window words */
  3003. WORD    WINAPI GetWindowWord(HWND, int);
  3004. WORD    WINAPI SetWindowWord(HWND, int, WORD);
  3005. LONG    WINAPI GetWindowLong(HWND, int);
  3006. LONG    WINAPI SetWindowLong(HWND, int, LONG);
  3007.  
  3008. /* Window field offsets for GetWindowLong() and GetWindowWord() */
  3009. #ifndef NOWINOFFSETS
  3010. #define GWL_WNDPROC        (-4)
  3011. #define GWW_HINSTANCE        (-6)
  3012. #define GWW_HWNDPARENT        (-8)
  3013. #define GWW_ID            (-12)
  3014. #define GWL_STYLE        (-16)
  3015. #define GWL_EXSTYLE        (-20)
  3016. #endif /* NOWINOFFSETS */
  3017.  
  3018. /****** Window size, position, Z-order, and visibility **********************/
  3019.  
  3020. #define CW_USEDEFAULT        ((int)0x8000)
  3021.  
  3022. void    WINAPI GetClientRect(HWND, RECT FAR*);
  3023. void    WINAPI GetWindowRect(HWND, RECT FAR*);
  3024.  
  3025.  
  3026. #if (WINVER >= 0x030a)
  3027. typedef struct tagWINDOWPLACEMENT
  3028. {
  3029.     UINT  length;
  3030.     UINT  flags;
  3031.     UINT  showCmd;
  3032.     POINT ptMinPosition;
  3033.     POINT ptMaxPosition;
  3034.     RECT  rcNormalPosition;
  3035. } WINDOWPLACEMENT;
  3036. typedef WINDOWPLACEMENT     *PWINDOWPLACEMENT;
  3037. typedef WINDOWPLACEMENT FAR* LPWINDOWPLACEMENT;
  3038.  
  3039. BOOL    WINAPI GetWindowPlacement(HWND, WINDOWPLACEMENT FAR*);
  3040. BOOL    WINAPI SetWindowPlacement(HWND, WINDOWPLACEMENT FAR*);
  3041. #endif /* WINVER >= 0x030a */
  3042.  
  3043.  
  3044. BOOL    WINAPI SetWindowPos(HWND, HWND, int, int, int, int, UINT);
  3045.  
  3046. /* SetWindowPos() and WINDOWPOS flags */
  3047. #define SWP_NOSIZE        0x0001
  3048. #define SWP_NOMOVE        0x0002
  3049. #define SWP_NOZORDER        0x0004
  3050. #define SWP_NOREDRAW        0x0008
  3051. #define SWP_NOACTIVATE        0x0010
  3052. #define SWP_FRAMECHANGED    0x0020  /* The frame changed: send WM_NCCALCSIZE */
  3053. #define SWP_SHOWWINDOW        0x0040
  3054. #define SWP_HIDEWINDOW        0x0080
  3055. #define SWP_NOCOPYBITS        0x0100
  3056. #define SWP_NOOWNERZORDER   0x0200  /* Don't do owner Z ordering */
  3057.  
  3058. #define SWP_DRAWFRAME        SWP_FRAMECHANGED
  3059. #define SWP_NOREPOSITION    SWP_NOOWNERZORDER
  3060.  
  3061.  
  3062. /* SetWindowPos() hwndInsertAfter field values */
  3063. #define HWND_TOP        ((HWND)NULL)
  3064. #define HWND_BOTTOM        ((HWND)1)
  3065. #define HWND_TOPMOST        ((HWND)-1)
  3066. #define HWND_NOTOPMOST      ((HWND)-2)
  3067.  
  3068. #ifndef NODEFERWINDOWPOS
  3069.  
  3070. DECLARE_HANDLE(HDWP);
  3071.  
  3072. HDWP    WINAPI BeginDeferWindowPos(int);
  3073. HDWP    WINAPI DeferWindowPos(HDWP, HWND, HWND, int, int, int, int, UINT);
  3074. BOOL    WINAPI EndDeferWindowPos(HDWP);
  3075.  
  3076. #endif /* NODEFERWINDOWPOS */
  3077.  
  3078. BOOL    WINAPI MoveWindow(HWND, int, int, int, int, BOOL);
  3079. BOOL    WINAPI BringWindowToTop(HWND);
  3080.  
  3081. #if (WINVER >= 0x030a)
  3082.  
  3083. #define WM_WINDOWPOSCHANGING 0x0046
  3084. #define WM_WINDOWPOSCHANGED 0x0047
  3085.  
  3086. /* WM_WINDOWPOSCHANGING/CHANGED struct pointed to by lParam */
  3087. typedef struct tagWINDOWPOS
  3088. {
  3089.     HWND    hwnd;
  3090.     HWND    hwndInsertAfter;
  3091.     int     x;
  3092.     int     y;
  3093.     int     cx;
  3094.     int     cy;
  3095.     UINT    flags;
  3096. } WINDOWPOS;
  3097. typedef WINDOWPOS FAR* LPWINDOWPOS;
  3098. #endif /* WINVER >= 0x030a */
  3099.  
  3100. #define WM_MOVE            0x0003
  3101. #define WM_SIZE            0x0005
  3102.  
  3103. /* WM_SIZE message wParam values */
  3104. #define SIZE_RESTORED        0
  3105. #define SIZE_MINIMIZED        1
  3106. #define SIZE_MAXIMIZED        2
  3107. #define SIZE_MAXSHOW        3
  3108. #define SIZE_MAXHIDE        4
  3109.  
  3110. /* Obsolete constant names */
  3111. #define SIZENORMAL        SIZE_RESTORED
  3112. #define SIZEICONIC        SIZE_MINIMIZED
  3113. #define SIZEFULLSCREEN        SIZE_MAXIMIZED
  3114. #define SIZEZOOMSHOW        SIZE_MAXSHOW
  3115. #define SIZEZOOMHIDE        SIZE_MAXHIDE
  3116.  
  3117. /****** Window proc implementation & subclassing support *********************/
  3118.  
  3119. LRESULT WINAPI DefWindowProc(HWND, UINT, WPARAM, LPARAM);
  3120.  
  3121. LRESULT WINAPI CallWindowProc(WNDPROC, HWND, UINT, WPARAM, LPARAM);
  3122.  
  3123. /****** Main window support **************************************************/
  3124.  
  3125. void    WINAPI AdjustWindowRect(RECT FAR*, DWORD, BOOL);
  3126. void    WINAPI AdjustWindowRectEx(RECT FAR*, DWORD, BOOL, DWORD);
  3127.  
  3128. #define WM_QUERYOPEN        0x0013
  3129. #define WM_CLOSE        0x0010
  3130.  
  3131. /* Struct pointed to by WM_GETMINMAXINFO lParam */
  3132. typedef struct tagMINMAXINFO
  3133. {
  3134.     POINT ptReserved;
  3135.     POINT ptMaxSize;
  3136.     POINT ptMaxPosition;
  3137.     POINT ptMinTrackSize;
  3138.     POINT ptMaxTrackSize;
  3139. } MINMAXINFO;
  3140. #define WM_GETMINMAXINFO    0x0024
  3141.  
  3142.  
  3143. BOOL    WINAPI FlashWindow(HWND, BOOL);
  3144.  
  3145. void    WINAPI ShowOwnedPopups(HWND, BOOL);
  3146.  
  3147. /* Obsolete functions */
  3148. BOOL    WINAPI OpenIcon(HWND);
  3149. void    WINAPI CloseWindow(HWND);
  3150. BOOL    WINAPI AnyPopup(void);
  3151. BOOL    WINAPI IsIconic(HWND);
  3152. BOOL    WINAPI IsZoomed(HWND);
  3153.  
  3154. /****** Window coordinate mapping and hit-testing ***************************/
  3155.  
  3156. void    WINAPI ClientToScreen(HWND, POINT FAR*);
  3157. void    WINAPI ScreenToClient(HWND, POINT FAR*);
  3158.  
  3159. #if (WINVER >= 0x030a)
  3160. void    WINAPI MapWindowPoints(HWND hwndFrom, HWND hwndTo, POINT FAR* lppt, UINT cpt);
  3161. #endif  /* WINVER >= 0x030a */
  3162.  
  3163. HWND    WINAPI WindowFromPoint(POINT);
  3164. HWND    WINAPI ChildWindowFromPoint(HWND, POINT);
  3165.  
  3166. /****** Window query and enumeration ****************************************/
  3167.  
  3168. HWND    WINAPI GetDesktopWindow(void);
  3169.  
  3170. HWND    WINAPI FindWindow(LPCSTR, LPCSTR);
  3171.  
  3172. #ifdef STRICT
  3173. typedef BOOL (CALLBACK* WNDENUMPROC)(HWND, LPARAM);
  3174. #else
  3175. typedef FARPROC WNDENUMPROC;
  3176. #endif
  3177.  
  3178. BOOL    WINAPI EnumWindows(WNDENUMPROC, LPARAM);
  3179. BOOL    WINAPI EnumChildWindows(HWND, WNDENUMPROC, LPARAM);
  3180. BOOL    WINAPI EnumTaskWindows(HTASK, WNDENUMPROC, LPARAM);
  3181.  
  3182. HWND    WINAPI GetTopWindow(HWND);
  3183.  
  3184. HWND    WINAPI GetWindow(HWND, UINT);
  3185. HWND    WINAPI GetNextWindow(HWND, UINT);
  3186.  
  3187. /* GetWindow() constants */
  3188. #define GW_HWNDFIRST    0
  3189. #define GW_HWNDLAST    1
  3190. #define GW_HWNDNEXT    2
  3191. #define GW_HWNDPREV    3
  3192. #define GW_OWNER    4
  3193. #define GW_CHILD    5
  3194.  
  3195.  
  3196. /****** Window property support *********************************************/
  3197.  
  3198. BOOL    WINAPI SetProp(HWND, LPCSTR, HANDLE);
  3199. HANDLE  WINAPI GetProp(HWND, LPCSTR);
  3200. HANDLE  WINAPI RemoveProp(HWND, LPCSTR);
  3201.  
  3202. #ifdef STRICT
  3203. typedef BOOL (CALLBACK* PROPENUMPROC)(HWND, LPCSTR, HANDLE);
  3204. #else
  3205. typedef FARPROC PROPENUMPROC;
  3206. #endif
  3207.  
  3208. int     WINAPI EnumProps(HWND, PROPENUMPROC);
  3209.  
  3210. /****** Window drawing support **********************************************/
  3211.  
  3212. HDC     WINAPI GetDC(HWND);
  3213. int     WINAPI ReleaseDC(HWND, HDC);
  3214.  
  3215. HDC     WINAPI GetWindowDC(HWND);
  3216.  
  3217. #if (WINVER >= 0x030a)
  3218. HDC     WINAPI GetDCEx(register HWND hwnd, HRGN hrgnClip, DWORD flags);
  3219.  
  3220. #define DCX_WINDOW        0x00000001L
  3221. #define DCX_CACHE        0x00000002L
  3222. #define DCX_NORESETATTRS    0x00000004L
  3223. #define DCX_CLIPCHILDREN    0x00000008L
  3224. #define DCX_CLIPSIBLINGS    0x00000010L
  3225. #define DCX_PARENTCLIP        0x00000020L
  3226.  
  3227. #define DCX_EXCLUDERGN        0x00000040L
  3228. #define DCX_INTERSECTRGN    0x00000080L
  3229.  
  3230.  
  3231. #define DCX_LOCKWINDOWUPDATE 0x00000400L
  3232.  
  3233.  
  3234. #define DCX_USESTYLE        0x00010000L
  3235. #define DCX_NORECOMPUTE     0x00100000L
  3236. #define DCX_VALIDATE        0x00200000L
  3237.  
  3238. #endif  /* WINVER >= 0x030a */
  3239.  
  3240. /****** Window repainting ***************************************************/
  3241.  
  3242. #define WM_PAINT        0x000F
  3243. #define WM_ERASEBKGND        0x0014
  3244. #define WM_ICONERASEBKGND   0x0027
  3245.  
  3246. /* BeginPaint() return structure */
  3247. typedef struct tagPAINTSTRUCT
  3248. {
  3249.     HDC     hdc;
  3250.     BOOL    fErase;
  3251.     RECT    rcPaint;
  3252.     BOOL    fRestore;
  3253.     BOOL    fIncUpdate;
  3254.     BYTE    rgbReserved[16];
  3255. } PAINTSTRUCT;
  3256. typedef PAINTSTRUCT* PPAINTSTRUCT;
  3257. typedef PAINTSTRUCT NEAR* NPPAINTSTRUCT;
  3258. typedef PAINTSTRUCT FAR* LPPAINTSTRUCT;
  3259.  
  3260. HDC     WINAPI BeginPaint(HWND, PAINTSTRUCT FAR*);
  3261. void    WINAPI EndPaint(HWND, const PAINTSTRUCT FAR*);
  3262.  
  3263. void    WINAPI UpdateWindow(HWND);
  3264.  
  3265. int     WINAPI ExcludeUpdateRgn(HDC, HWND);
  3266.  
  3267. #if (WINVER >= 0x030a)
  3268. BOOL    WINAPI LockWindowUpdate(HWND hwndLock);
  3269. #endif
  3270.  
  3271. BOOL    WINAPI GetUpdateRect(HWND, RECT FAR*, BOOL);
  3272. int     WINAPI GetUpdateRgn(HWND, HRGN, BOOL);
  3273.  
  3274. void    WINAPI InvalidateRect(HWND, const RECT FAR*, BOOL);
  3275. void    WINAPI ValidateRect(HWND, const RECT FAR*);
  3276.  
  3277. void    WINAPI InvalidateRgn(HWND, HRGN, BOOL);
  3278. void    WINAPI ValidateRgn(HWND, HRGN);
  3279.  
  3280. #if (WINVER >= 0x030a)
  3281. BOOL    WINAPI RedrawWindow(HWND hwnd, const RECT FAR* lprcUpdate, HRGN hrgnUpdate, UINT flags);
  3282.  
  3283. #define RDW_INVALIDATE        0x0001
  3284. #define RDW_INTERNALPAINT    0x0002
  3285. #define RDW_ERASE        0x0004
  3286.  
  3287. #define RDW_VALIDATE        0x0008
  3288. #define RDW_NOINTERNALPAINT    0x0010
  3289. #define RDW_NOERASE        0x0020
  3290.  
  3291. #define RDW_NOCHILDREN        0x0040
  3292. #define RDW_ALLCHILDREN     0x0080
  3293.  
  3294. #define RDW_UPDATENOW        0x0100
  3295. #define RDW_ERASENOW        0x0200
  3296.  
  3297. #define RDW_FRAME               0x0400
  3298. #define RDW_NOFRAME             0x0800
  3299.  
  3300. #endif /* WINVER >= 0x030a */
  3301.  
  3302. /****** Window scrolling ****************************************************/
  3303.  
  3304. void    WINAPI ScrollWindow(HWND, int, int, const RECT FAR*, const RECT FAR*);
  3305. BOOL    WINAPI ScrollDC(HDC, int, int, const RECT FAR*, const RECT FAR*, HRGN, RECT FAR*);
  3306.  
  3307. #if (WINVER >= 0x030a)
  3308.  
  3309. int     WINAPI ScrollWindowEx(HWND hwnd, int dx, int dy,
  3310.                 const RECT FAR* prcScroll, const RECT FAR* prcClip,
  3311.                 HRGN hrgnUpdate, RECT FAR* prcUpdate, UINT flags);
  3312.  
  3313. #define SW_SCROLLCHILDREN   0x0001
  3314. #define SW_INVALIDATE       0x0002
  3315. #define SW_ERASE            0x0004
  3316.  
  3317.  
  3318. #endif /* WINVER >= 0x030a */
  3319.  
  3320. /****** Non-client window area management ************************************/
  3321.  
  3322. #define WM_NCPAINT        0x0085
  3323.  
  3324. #define WM_NCCALCSIZE        0x0083
  3325.  
  3326. #if (WINVER >= 0x030a)
  3327. /* WM_NCCALCSIZE return flags */
  3328. #define WVR_ALIGNTOP        0x0010
  3329. #define WVR_ALIGNLEFT        0x0020
  3330. #define WVR_ALIGNBOTTOM     0x0040
  3331. #define WVR_ALIGNRIGHT        0x0080
  3332. #define WVR_HREDRAW        0x0100
  3333. #define WVR_VREDRAW        0x0200
  3334. #define WVR_REDRAW        (WVR_HREDRAW | WVR_VREDRAW)
  3335. #define WVR_VALIDRECTS        0x0400
  3336.  
  3337.  
  3338. /* WM_NCCALCSIZE parameter structure */
  3339. typedef struct tagNCCALCSIZE_PARAMS
  3340. {
  3341.     RECT       rgrc[3];
  3342.     WINDOWPOS FAR* lppos;
  3343. } NCCALCSIZE_PARAMS;
  3344. #else   /* WINVER >= 0x030a */
  3345. typedef struct tagNCCALCSIZE_PARAMS
  3346. {
  3347.     RECT    rgrc[2];
  3348. } NCCALCSIZE_PARAMS;
  3349. #endif  /* WINVER >= 0x030a */
  3350. typedef NCCALCSIZE_PARAMS FAR* LPNCCALCSIZE_PARAMS;
  3351.  
  3352. #define WM_NCHITTEST        0x0084
  3353.  
  3354. /* WM_NCHITTEST return codes */
  3355. #define HTERROR         (-2)
  3356. #define HTTRANSPARENT        (-1)
  3357. #define HTNOWHERE        0
  3358. #define HTCLIENT        1
  3359. #define HTCAPTION        2
  3360. #define HTSYSMENU        3
  3361. #define HTSIZE            4
  3362. #define HTMENU            5
  3363. #define HTHSCROLL        6
  3364. #define HTVSCROLL        7
  3365. #define HTMINBUTTON        8
  3366. #define HTMAXBUTTON        9
  3367. #define HTLEFT            10
  3368. #define HTRIGHT         11
  3369. #define HTTOP            12
  3370. #define HTTOPLEFT        13
  3371. #define HTTOPRIGHT        14
  3372. #define HTBOTTOM        15
  3373. #define HTBOTTOMLEFT        16
  3374. #define HTBOTTOMRIGHT        17
  3375. #define HTBORDER        18
  3376. #define HTGROWBOX        HTSIZE
  3377. #define HTREDUCE        HTMINBUTTON
  3378. #define HTZOOM            HTMAXBUTTON
  3379.  
  3380. /****** Drag-and-drop support ***********************************************/
  3381.  
  3382. #define WM_QUERYDRAGICON    0x0037
  3383. #define WM_DROPFILES        0x0233
  3384.  
  3385. /****** Window activation ***************************************************/
  3386.  
  3387. HWND    WINAPI SetActiveWindow(HWND);
  3388. HWND    WINAPI GetActiveWindow(void);
  3389.  
  3390. HWND    WINAPI GetLastActivePopup(HWND);
  3391.  
  3392. /* WM_ACTIVATE state values */
  3393. #define WA_INACTIVE        0
  3394. #define WA_ACTIVE        1
  3395. #define WA_CLICKACTIVE        2
  3396.  
  3397. #define WM_ACTIVATE        0x0006
  3398. #define WM_ACTIVATEAPP        0x001C
  3399. #define WM_NCACTIVATE        0x0086
  3400.  
  3401. /****** Keyboard input support **********************************************/
  3402.  
  3403. HWND    WINAPI SetFocus(HWND);
  3404. HWND    WINAPI GetFocus(void);
  3405.  
  3406. int     WINAPI GetKeyState(int);
  3407. int     WINAPI GetAsyncKeyState(int);
  3408.  
  3409. void    WINAPI GetKeyboardState(BYTE FAR* );
  3410. void    WINAPI SetKeyboardState(BYTE FAR* );
  3411.  
  3412. #define WM_SETFOCUS        0x0007
  3413. #define WM_KILLFOCUS        0x0008
  3414.  
  3415. #define WM_KEYDOWN        0x0100
  3416. #define WM_KEYUP        0x0101
  3417.  
  3418. #define WM_CHAR            0x0102
  3419. #define WM_DEADCHAR        0x0103
  3420.  
  3421. #define WM_SYSKEYDOWN        0x0104
  3422. #define WM_SYSKEYUP        0x0105
  3423.  
  3424. #define WM_SYSCHAR        0x0106
  3425. #define WM_SYSDEADCHAR        0x0107
  3426.  
  3427.  
  3428. /* Keyboard message range */
  3429. #define WM_KEYFIRST        0x0100
  3430. #define WM_KEYLAST        0x0108
  3431.  
  3432. /* WM_KEYUP/DOWN/CHAR HIWORD(lParam) flags */
  3433. #define KF_EXTENDED        0x0100
  3434. #define KF_DLGMODE        0x0800
  3435. #define KF_MENUMODE        0x1000
  3436. #define KF_ALTDOWN        0x2000
  3437. #define KF_REPEAT        0x4000
  3438. #define KF_UP            0x8000
  3439.  
  3440. /* Virtual key codes */
  3441. #ifndef NOVIRTUALKEYCODES
  3442. #define VK_LBUTTON        0x01
  3443. #define VK_RBUTTON        0x02
  3444. #define VK_CANCEL        0x03
  3445. #define VK_MBUTTON          0x04
  3446. #define VK_BACK         0x08
  3447. #define VK_TAB            0x09
  3448. #define VK_CLEAR        0x0C
  3449. #define VK_RETURN        0x0D
  3450. #define VK_SHIFT        0x10
  3451. #define VK_CONTROL        0x11
  3452. #define VK_MENU         0x12
  3453. #define VK_PAUSE        0x13
  3454. #define VK_CAPITAL        0x14
  3455. #define VK_ESCAPE        0x1B
  3456. #define VK_SPACE        0x20
  3457. #define VK_PRIOR        0x21
  3458. #define VK_NEXT         0x22
  3459. #define VK_END            0x23
  3460. #define VK_HOME         0x24
  3461. #define VK_LEFT         0x25
  3462. #define VK_UP            0x26
  3463. #define VK_RIGHT        0x27
  3464. #define VK_DOWN         0x28
  3465. #define VK_SELECT        0x29
  3466. #define VK_PRINT        0x2A
  3467. #define VK_EXECUTE        0x2B
  3468. #define VK_SNAPSHOT        0x2C
  3469. #define VK_INSERT        0x2D
  3470. #define VK_DELETE        0x2E
  3471. #define VK_HELP         0x2F
  3472. #define VK_NUMPAD0        0x60
  3473. #define VK_NUMPAD1        0x61
  3474. #define VK_NUMPAD2        0x62
  3475. #define VK_NUMPAD3        0x63
  3476. #define VK_NUMPAD4        0x64
  3477. #define VK_NUMPAD5        0x65
  3478. #define VK_NUMPAD6        0x66
  3479. #define VK_NUMPAD7        0x67
  3480. #define VK_NUMPAD8        0x68
  3481. #define VK_NUMPAD9        0x69
  3482. #define VK_MULTIPLY        0x6A
  3483. #define VK_ADD            0x6B
  3484. #define VK_SEPARATOR        0x6C
  3485. #define VK_SUBTRACT        0x6D
  3486. #define VK_DECIMAL        0x6E
  3487. #define VK_DIVIDE        0x6F
  3488. #define VK_F1            0x70
  3489. #define VK_F2            0x71
  3490. #define VK_F3            0x72
  3491. #define VK_F4            0x73
  3492. #define VK_F5            0x74
  3493. #define VK_F6            0x75
  3494. #define VK_F7            0x76
  3495. #define VK_F8            0x77
  3496. #define VK_F9            0x78
  3497. #define VK_F10            0x79
  3498. #define VK_F11            0x7A
  3499. #define VK_F12            0x7B
  3500. #define VK_F13            0x7C
  3501. #define VK_F14            0x7D
  3502. #define VK_F15            0x7E
  3503. #define VK_F16            0x7F
  3504. #define VK_F17            0x80
  3505. #define VK_F18            0x81
  3506. #define VK_F19            0x82
  3507. #define VK_F20            0x83
  3508. #define VK_F21            0x84
  3509. #define VK_F22            0x85
  3510. #define VK_F23            0x86
  3511. #define VK_F24            0x87
  3512. #define VK_NUMLOCK        0x90
  3513. #define VK_SCROLL           0x91
  3514.  
  3515. /* VK_A thru VK_Z are the same as their ASCII equivalents: 'A' thru 'Z' */
  3516. /* VK_0 thru VK_9 are the same as their ASCII equivalents: '0' thru '0' */
  3517.  
  3518. #endif /* NOVIRTUALKEYCODES */
  3519.  
  3520.  
  3521. /* SetWindowsHook() keyboard hook */
  3522. #define WH_KEYBOARD        2
  3523.  
  3524. /****** Mouse input support *************************************************/
  3525.  
  3526. HWND    WINAPI SetCapture(HWND);
  3527. void    WINAPI ReleaseCapture(void);
  3528. HWND    WINAPI GetCapture(void);
  3529.  
  3530. BOOL    WINAPI SwapMouseButton(BOOL);
  3531.  
  3532. /* Mouse input messages */
  3533. #define WM_MOUSEMOVE        0x0200
  3534. #define WM_LBUTTONDOWN        0x0201
  3535. #define WM_LBUTTONUP        0x0202
  3536. #define WM_LBUTTONDBLCLK    0x0203
  3537. #define WM_RBUTTONDOWN        0x0204
  3538. #define WM_RBUTTONUP        0x0205
  3539. #define WM_RBUTTONDBLCLK    0x0206
  3540. #define WM_MBUTTONDOWN        0x0207
  3541. #define WM_MBUTTONUP        0x0208
  3542. #define WM_MBUTTONDBLCLK    0x0209
  3543.  
  3544. /* Mouse input message range */
  3545. #define WM_MOUSEFIRST        0x0200
  3546. #define WM_MOUSELAST        0x0209
  3547.  
  3548. /* Mouse message wParam key states */
  3549. #ifndef NOKEYSTATES
  3550. #define MK_LBUTTON        0x0001
  3551. #define MK_RBUTTON        0x0002
  3552. #define MK_SHIFT        0x0004
  3553. #define MK_CONTROL        0x0008
  3554. #define MK_MBUTTON        0x0010
  3555. #endif /* NOKEYSTATES */
  3556.  
  3557. /* Non-client mouse messages */
  3558. #define WM_NCMOUSEMOVE        0x00A0
  3559. #define WM_NCLBUTTONDOWN    0x00A1
  3560. #define WM_NCLBUTTONUP        0x00A2
  3561. #define WM_NCLBUTTONDBLCLK  0x00A3
  3562. #define WM_NCRBUTTONDOWN    0x00A4
  3563. #define WM_NCRBUTTONUP        0x00A5
  3564. #define WM_NCRBUTTONDBLCLK  0x00A6
  3565. #define WM_NCMBUTTONDOWN    0x00A7
  3566. #define WM_NCMBUTTONUP        0x00A8
  3567. #define WM_NCMBUTTONDBLCLK  0x00A9
  3568.  
  3569. /* Mouse click activation support */
  3570. #define WM_MOUSEACTIVATE    0x0021
  3571.  
  3572. /* WM_MOUSEACTIVATE return codes */
  3573. #define MA_ACTIVATE        1
  3574. #define MA_ACTIVATEANDEAT   2
  3575. #define MA_NOACTIVATE        3
  3576. #if (WINVER >= 0x030a)
  3577. #define MA_NOACTIVATEANDEAT 4
  3578. #endif /* WINVER >= 0x030a */
  3579.  
  3580. /* SetWindowsHook() mouse hook */
  3581. #ifndef NOWH
  3582. #define WH_MOUSE        7
  3583.  
  3584. typedef struct tagMOUSEHOOKSTRUCT
  3585. {
  3586.     POINT   pt;
  3587.     HWND    hwnd;
  3588.     UINT    wHitTestCode;
  3589.     DWORD   dwExtraInfo;
  3590. } MOUSEHOOKSTRUCT;
  3591. typedef MOUSEHOOKSTRUCT  FAR* LPMOUSEHOOKSTRUCT;
  3592. #endif    /* NOWH */
  3593.  
  3594. /****** Mode control ********************************************************/
  3595.  
  3596. #define WM_CANCELMODE        0x001F
  3597.  
  3598. /****** System modal window support *****************************************/
  3599.  
  3600. HWND    WINAPI GetSysModalWindow(void);
  3601. HWND    WINAPI SetSysModalWindow(HWND);
  3602.  
  3603. /****** Timer support *******************************************************/
  3604.  
  3605. #ifdef STRICT
  3606. typedef void (CALLBACK* TIMERPROC)(HWND, UINT, UINT, DWORD);
  3607. #else
  3608. typedef FARPROC TIMERPROC;
  3609. #endif
  3610.  
  3611. UINT    WINAPI SetTimer(HWND, UINT, UINT, TIMERPROC);
  3612.  
  3613. BOOL    WINAPI KillTimer(HWND, UINT);
  3614.  
  3615. #define WM_TIMER        0x0113
  3616.  
  3617. /****** Accelerator support *************************************************/
  3618.  
  3619. DECLARE_HANDLE(HACCEL);
  3620.  
  3621. HACCEL  WINAPI LoadAccelerators(HINSTANCE, LPCSTR);
  3622.  
  3623. #ifndef NOMSG
  3624. int     WINAPI TranslateAccelerator(HWND, HACCEL, MSG FAR*);
  3625. #endif
  3626.  
  3627. /****** Menu support ********************************************************/
  3628.  
  3629. #ifndef NOMENUS
  3630.  
  3631. /* Menu template header */
  3632. typedef struct 
  3633. {
  3634.     UINT    versionNumber;
  3635.     UINT    offset;
  3636. } MENUITEMTEMPLATEHEADER;
  3637.  
  3638. /* Menu template item struct */
  3639. typedef struct
  3640. {
  3641.     UINT    mtOption;
  3642.     UINT    mtID;
  3643.     LPSTR   mtString;
  3644. } MENUITEMTEMPLATE;
  3645.  
  3646. #if (WINVER >= 0x030a)
  3647. BOOL    WINAPI IsMenu(HMENU);
  3648. #endif /* WINVER >= 0x030a */
  3649.  
  3650. HMENU   WINAPI CreateMenu(void);
  3651. HMENU   WINAPI CreatePopupMenu(void);
  3652. HMENU   WINAPI LoadMenu(HINSTANCE, LPCSTR);
  3653. HMENU   WINAPI LoadMenuIndirect(const void FAR*);
  3654.  
  3655. BOOL    WINAPI DestroyMenu(HMENU);
  3656.  
  3657. HMENU   WINAPI GetMenu(HWND);
  3658. BOOL    WINAPI SetMenu(HWND, HMENU);
  3659.  
  3660. HMENU   WINAPI GetSystemMenu(HWND, BOOL);
  3661.  
  3662. void    WINAPI DrawMenuBar(HWND);
  3663.  
  3664. BOOL    WINAPI HiliteMenuItem(HWND, HMENU, UINT, UINT);
  3665.  
  3666. BOOL    WINAPI InsertMenu(HMENU, UINT, UINT, UINT, LPCSTR);
  3667. BOOL    WINAPI AppendMenu(HMENU, UINT, UINT, LPCSTR);
  3668. BOOL    WINAPI ModifyMenu(HMENU, UINT, UINT, UINT, LPCSTR);
  3669. BOOL    WINAPI RemoveMenu(HMENU, UINT, UINT);
  3670. BOOL    WINAPI DeleteMenu(HMENU, UINT, UINT);
  3671.  
  3672. BOOL    WINAPI ChangeMenu(HMENU, UINT, LPCSTR, UINT, UINT);
  3673.  
  3674. #define MF_INSERT        0x0000
  3675. #define MF_CHANGE        0x0080
  3676. #define MF_APPEND        0x0100
  3677. #define MF_DELETE        0x0200
  3678. #define MF_REMOVE        0x1000
  3679.  
  3680. /* Menu flags for Add/Check/EnableMenuItem() */
  3681. #define MF_BYCOMMAND        0x0000
  3682. #define MF_BYPOSITION        0x0400
  3683.  
  3684. #define MF_SEPARATOR        0x0800
  3685.  
  3686. #define MF_ENABLED        0x0000
  3687. #define MF_GRAYED        0x0001
  3688. #define MF_DISABLED        0x0002
  3689.  
  3690. #define MF_UNCHECKED        0x0000
  3691. #define MF_CHECKED        0x0008
  3692. #define MF_USECHECKBITMAPS  0x0200
  3693.  
  3694. #define MF_STRING        0x0000
  3695. #define MF_BITMAP        0x0004
  3696. #define MF_OWNERDRAW        0x0100
  3697.  
  3698. #define MF_POPUP        0x0010
  3699. #define MF_MENUBARBREAK     0x0020
  3700. #define MF_MENUBREAK        0x0040
  3701.  
  3702. #define MF_UNHILITE        0x0000
  3703. #define MF_HILITE        0x0080
  3704.  
  3705. #define MF_SYSMENU        0x2000
  3706. #define MF_HELP         0x4000
  3707. #define MF_MOUSESELECT        0x8000
  3708.  
  3709.  
  3710. #define MF_END            0x0080  /* Only valid in menu resource templates */
  3711.  
  3712. BOOL    WINAPI EnableMenuItem(HMENU, UINT, UINT);
  3713. BOOL    WINAPI CheckMenuItem(HMENU, UINT, UINT);
  3714.  
  3715. HMENU   WINAPI GetSubMenu(HMENU, int);
  3716.  
  3717. int     WINAPI GetMenuItemCount(HMENU);
  3718. UINT    WINAPI GetMenuItemID(HMENU, int);
  3719.  
  3720. int     WINAPI GetMenuString(HMENU, UINT, LPSTR, int, UINT);
  3721. UINT    WINAPI GetMenuState(HMENU, UINT, UINT);
  3722.  
  3723. BOOL    WINAPI SetMenuItemBitmaps(HMENU, UINT, UINT, HBITMAP, HBITMAP);
  3724. DWORD   WINAPI GetMenuCheckMarkDimensions(void);
  3725.  
  3726. BOOL    WINAPI TrackPopupMenu(HMENU, UINT, int, int, int, HWND, const RECT FAR*);
  3727.  
  3728. /* Flags for TrackPopupMenu */
  3729. #define TPM_LEFTBUTTON  0x0000
  3730. #if (WINVER >= 0x030a)
  3731. #define TPM_RIGHTBUTTON 0x0002
  3732. #define TPM_LEFTALIGN   0x0000
  3733. #define TPM_CENTERALIGN 0x0004
  3734. #define TPM_RIGHTALIGN  0x0008
  3735. #endif /* WINVER >= 0x030a */
  3736.  
  3737. #endif  /* NOMENUS */
  3738.  
  3739. /* Menu messages */
  3740. #define WM_INITMENU        0x0116
  3741. #define WM_INITMENUPOPUP    0x0117
  3742.  
  3743. #ifndef NOMENUS
  3744.  
  3745. #define WM_MENUSELECT        0x011F
  3746. #define WM_MENUCHAR        0x0120
  3747.  
  3748. #endif /* NOMENUS */
  3749.  
  3750. /* Menu and control command messages */
  3751. #define WM_COMMAND        0x0111
  3752.  
  3753. /****** Scroll bar support **************************************************/
  3754.  
  3755. #ifndef NOSCROLL
  3756.  
  3757. #define WM_HSCROLL        0x0114
  3758. #define WM_VSCROLL        0x0115
  3759.  
  3760. /* WM_H/VSCROLL commands */
  3761. #define SB_LINEUP        0
  3762. #define SB_LINELEFT        0
  3763. #define SB_LINEDOWN        1
  3764. #define SB_LINERIGHT        1
  3765. #define SB_PAGEUP        2
  3766. #define SB_PAGELEFT        2
  3767. #define SB_PAGEDOWN        3
  3768. #define SB_PAGERIGHT        3
  3769. #define SB_THUMBPOSITION    4
  3770. #define SB_THUMBTRACK        5
  3771. #define SB_TOP            6
  3772. #define SB_LEFT         6
  3773. #define SB_BOTTOM        7
  3774. #define SB_RIGHT        7
  3775. #define SB_ENDSCROLL        8
  3776.  
  3777. /* Scroll bar selection constants */
  3778. #define SB_HORZ            0
  3779. #define SB_VERT            1
  3780. #define SB_CTL            2
  3781. #define SB_BOTH            3
  3782.  
  3783. int     WINAPI SetScrollPos(HWND, int, int, BOOL);
  3784. int     WINAPI GetScrollPos(HWND, int);
  3785. void    WINAPI SetScrollRange(HWND, int, int, int, BOOL);
  3786. void    WINAPI GetScrollRange(HWND, int, int FAR*, int FAR*);
  3787. void    WINAPI ShowScrollBar(HWND, int, BOOL);
  3788. BOOL    WINAPI EnableScrollBar(HWND, int, UINT);
  3789.  
  3790. /* EnableScrollBar() flags */
  3791. #define ESB_ENABLE_BOTH     0x0000
  3792. #define ESB_DISABLE_BOTH    0x0003
  3793.  
  3794. #define ESB_DISABLE_LEFT    0x0001
  3795. #define ESB_DISBALE_RIGHT   0x0002
  3796.  
  3797. #define ESB_DISABLE_UP      0x0001
  3798. #define ESB_DISABLE_DOWN    0x0002
  3799.  
  3800. #define ESB_DISABLE_LTUP    ESB_DISABLE_LEFT
  3801. #define ESB_DISABLE_RTDN    ESB_DISABLE_RIGHT
  3802.  
  3803. #endif  /* NOSCROLL */
  3804.  
  3805. /******* Clipboard manager **************************************************/
  3806.  
  3807. #ifndef NOCLIPBOARD
  3808.  
  3809. /* Predefined Clipboard Formats */
  3810. #define CF_TEXT          1
  3811. #define CF_BITMAP         2
  3812. #define CF_METAFILEPICT      3
  3813. #define CF_SYLK          4
  3814. #define CF_DIF             5
  3815. #define CF_TIFF          6
  3816. #define CF_OEMTEXT         7
  3817. #define CF_DIB             8
  3818. #define CF_PALETTE         9
  3819. #define CF_PENDATA          10
  3820. #define CF_RIFF             11
  3821. #define CF_WAVE             12
  3822.  
  3823. #define CF_OWNERDISPLAY     0x0080
  3824. #define CF_DSPTEXT        0x0081
  3825. #define CF_DSPBITMAP        0x0082
  3826. #define CF_DSPMETAFILEPICT  0x0083
  3827.  
  3828. /* "Private" formats don't get GlobalFree()'d */
  3829. #define CF_PRIVATEFIRST     0x0200
  3830. #define CF_PRIVATELAST        0x02FF
  3831.  
  3832. /* "GDIOBJ" formats do get DeleteObject()'d */
  3833. #define CF_GDIOBJFIRST        0x0300
  3834. #define CF_GDIOBJLAST        0x03FF
  3835.  
  3836. /* Clipboard Manager Functions */
  3837. BOOL    WINAPI OpenClipboard(HWND);
  3838. BOOL    WINAPI CloseClipboard(void);
  3839. BOOL    WINAPI EmptyClipboard(void);
  3840.  
  3841. #if (WINVER >= 0x030a)
  3842. HWND    WINAPI GetOpenClipboardWindow(void);
  3843. #endif /* WINVER >= 0x030a */
  3844.  
  3845. HWND    WINAPI GetClipboardOwner(void);
  3846.  
  3847. HWND    WINAPI SetClipboardViewer(HWND);
  3848. HWND    WINAPI GetClipboardViewer(void);
  3849.  
  3850. HANDLE  WINAPI SetClipboardData(UINT, HANDLE);
  3851. HANDLE  WINAPI GetClipboardData(UINT);
  3852.  
  3853. BOOL    WINAPI IsClipboardFormatAvailable(UINT);
  3854. int     WINAPI GetPriorityClipboardFormat(UINT FAR*, int);
  3855.  
  3856. UINT    WINAPI RegisterClipboardFormat(LPCSTR);
  3857. int     WINAPI CountClipboardFormats(void);
  3858. UINT    WINAPI EnumClipboardFormats(UINT);
  3859. int     WINAPI GetClipboardFormatName(UINT, LPSTR, int);
  3860.  
  3861. BOOL    WINAPI ChangeClipboardChain(HWND, HWND);
  3862.  
  3863. /* Clipboard command messages */
  3864. #define WM_CUT            0x0300
  3865. #define WM_COPY            0x0301
  3866. #define WM_PASTE        0x0302
  3867. #define WM_CLEAR        0x0303
  3868. #define WM_UNDO            0x0304
  3869.  
  3870. /* Clipboard owner messages */
  3871. #define WM_RENDERFORMAT        0x0305
  3872. #define WM_RENDERALLFORMATS 0x0306
  3873. #define WM_DESTROYCLIPBOARD 0x0307
  3874.  
  3875. /* Clipboard viewer messages */
  3876. #define WM_DRAWCLIPBOARD    0x0308
  3877. #define WM_PAINTCLIPBOARD   0x0309
  3878. #define WM_SIZECLIPBOARD    0x030B
  3879. #define WM_VSCROLLCLIPBOARD 0x030A
  3880. #define WM_HSCROLLCLIPBOARD 0x030E
  3881. #define WM_ASKCBFORMATNAME  0x030C
  3882. #define WM_CHANGECBCHAIN    0x030D
  3883.  
  3884. #endif /* NOCLIPBOARD */
  3885.  
  3886. /****** Mouse cursor support *************************************************/
  3887.  
  3888. HCURSOR WINAPI LoadCursor(HINSTANCE, LPCSTR);
  3889. HCURSOR WINAPI CreateCursor(HINSTANCE, int, int, int, int, const void FAR*, const void FAR*);
  3890. BOOL    WINAPI DestroyCursor(HCURSOR);
  3891.  
  3892. #if (WINVER >= 0x030a)
  3893. HCURSOR WINAPI CopyCursor(HINSTANCE, HCURSOR);
  3894. #endif /* WINVER >= 0x030a */
  3895.  
  3896. int     WINAPI ShowCursor(BOOL);
  3897.  
  3898. void    WINAPI SetCursorPos(int, int);
  3899. void    WINAPI GetCursorPos(POINT FAR*);
  3900.  
  3901. HCURSOR WINAPI SetCursor(HCURSOR);
  3902.  
  3903. #if (WINVER >= 0x030a)
  3904. HCURSOR WINAPI GetCursor(void);
  3905. #endif /* WINVER >= 0x030a */
  3906.  
  3907. void    WINAPI ClipCursor(const RECT FAR*);
  3908. #if (WINVER >= 0x030a)
  3909. void    WINAPI GetClipCursor(RECT FAR*);
  3910. #endif
  3911.  
  3912. /* Standard cursor resource IDs */
  3913. #define IDC_ARROW        MAKEINTRESOURCE(32512)
  3914. #define IDC_IBEAM        MAKEINTRESOURCE(32513)
  3915. #define IDC_WAIT        MAKEINTRESOURCE(32514)
  3916. #define IDC_CROSS        MAKEINTRESOURCE(32515)
  3917. #define IDC_UPARROW        MAKEINTRESOURCE(32516)
  3918. #define IDC_SIZE        MAKEINTRESOURCE(32640)
  3919. #define IDC_ICON        MAKEINTRESOURCE(32641)
  3920. #define IDC_SIZENWSE        MAKEINTRESOURCE(32642)
  3921. #define IDC_SIZENESW        MAKEINTRESOURCE(32643)
  3922. #define IDC_SIZEWE        MAKEINTRESOURCE(32644)
  3923. #define IDC_SIZENS        MAKEINTRESOURCE(32645)
  3924.  
  3925. #define WM_SETCURSOR        0x0020
  3926.  
  3927. /****** Icon support *********************************************************/
  3928.  
  3929. HICON   WINAPI LoadIcon(HINSTANCE, LPCSTR);
  3930. HICON   WINAPI CreateIcon(HINSTANCE, int, int, BYTE, BYTE, const void FAR*, const void FAR*);
  3931. BOOL    WINAPI DestroyIcon(HICON);
  3932.  
  3933. #if (WINVER >= 0x030a)
  3934. HICON   WINAPI CopyIcon(HINSTANCE, HICON);
  3935. #endif /* WINVER >= 0x030a */
  3936.  
  3937. BOOL    WINAPI DrawIcon(HDC, int, int, HICON);
  3938.  
  3939. #ifndef NOICONS
  3940.  
  3941. /* Standard icon resource IDs */
  3942. #define IDI_APPLICATION     MAKEINTRESOURCE(32512)
  3943. #define IDI_HAND        MAKEINTRESOURCE(32513)
  3944. #define IDI_QUESTION        MAKEINTRESOURCE(32514)
  3945. #define IDI_EXCLAMATION     MAKEINTRESOURCE(32515)
  3946. #define IDI_ASTERISK        MAKEINTRESOURCE(32516)
  3947.  
  3948. #endif /* NOICONS */
  3949.  
  3950. /****** Message Box support *************************************************/
  3951.  
  3952. #ifndef NOMB
  3953.  
  3954. int     WINAPI MessageBox(HWND, LPCSTR, LPCSTR, UINT);
  3955. void    WINAPI MessageBeep(UINT);
  3956.  
  3957. #define MB_OK            0x0000
  3958. #define MB_OKCANCEL        0x0001
  3959. #define MB_ABORTRETRYIGNORE 0x0002
  3960. #define MB_YESNOCANCEL        0x0003
  3961. #define MB_YESNO        0x0004
  3962. #define MB_RETRYCANCEL        0x0005
  3963. #define MB_TYPEMASK        0x000F
  3964.  
  3965. #define MB_ICONHAND        0x0010
  3966. #define MB_ICONQUESTION        0x0020
  3967. #define MB_ICONEXCLAMATION  0x0030
  3968. #define MB_ICONASTERISK     0x0040
  3969. #define MB_ICONMASK        0x00F0
  3970.  
  3971. #define MB_ICONINFORMATION  MB_ICONASTERISK
  3972. #define MB_ICONSTOP         MB_ICONHAND
  3973.  
  3974. #define MB_DEFBUTTON1        0x0000
  3975. #define MB_DEFBUTTON2        0x0100
  3976. #define MB_DEFBUTTON3        0x0200
  3977. #define MB_DEFMASK        0x0F00
  3978.  
  3979. #define MB_APPLMODAL        0x0000
  3980. #define MB_SYSTEMMODAL        0x1000
  3981. #define MB_TASKMODAL        0x2000
  3982.  
  3983. #define MB_NOFOCUS        0x8000
  3984.  
  3985.  
  3986.  
  3987. #endif /* NOMB */
  3988.  
  3989. /****** Caret support ********************************************************/
  3990.  
  3991. void    WINAPI CreateCaret(HWND, HBITMAP, int, int);
  3992. void    WINAPI DestroyCaret(void);
  3993.  
  3994. void    WINAPI SetCaretPos(int, int);
  3995. void    WINAPI GetCaretPos(POINT FAR*);
  3996.  
  3997. void    WINAPI HideCaret(HWND);
  3998. void    WINAPI ShowCaret(HWND);
  3999.  
  4000. UINT    WINAPI GetCaretBlinkTime(void);
  4001. void    WINAPI SetCaretBlinkTime(UINT);
  4002.  
  4003. /****** WM_SYSCOMMAND support ***********************************************/
  4004.  
  4005. #define WM_SYSCOMMAND    0x0112
  4006.  
  4007. #ifndef NOSYSCOMMANDS
  4008.  
  4009. /* System Menu Command Values */
  4010. #define SC_SIZE        0xF000
  4011. #define SC_MOVE        0xF010
  4012. #define SC_MINIMIZE    0xF020
  4013. #define SC_MAXIMIZE    0xF030
  4014. #define SC_NEXTWINDOW    0xF040
  4015. #define SC_PREVWINDOW    0xF050
  4016. #define SC_CLOSE    0xF060
  4017. #define SC_VSCROLL    0xF070
  4018. #define SC_HSCROLL    0xF080
  4019. #define SC_MOUSEMENU    0xF090
  4020. #define SC_KEYMENU    0xF100
  4021. #define SC_ARRANGE    0xF110
  4022. #define SC_RESTORE    0xF120
  4023. #define SC_TASKLIST    0xF130
  4024. #define SC_SCREENSAVE   0xF140
  4025. #define SC_HOTKEY       0xF150
  4026.  
  4027. /* Obsolete names */
  4028. #define SC_ICON        SC_MINIMIZE
  4029. #define SC_ZOOM     SC_MAXIMIZE
  4030.  
  4031. /* SC_HOTKEY support messages */
  4032. #define WM_SETHOTKEY    0x0032
  4033. #define WM_GETHOTKEY    0x0033
  4034.  
  4035. #endif /* NOSYSCOMMANDS */
  4036.  
  4037. /****** MDI Support *********************************************************/
  4038.  
  4039. #ifndef NOMDI
  4040.  
  4041. /* CreateWindow lpParams structure for creating MDI client */
  4042. typedef struct tagCLIENTCREATESTRUCT
  4043. {
  4044.     HANDLE hWindowMenu;
  4045.     UINT   idFirstChild;
  4046. } CLIENTCREATESTRUCT;
  4047. typedef CLIENTCREATESTRUCT FAR* LPCLIENTCREATESTRUCT;
  4048.  
  4049. /* MDI client style bits */
  4050. #if (WINVER >= 0x030a)
  4051. #define MDIS_ALLCHILDSTYLES 0x0001
  4052. #endif  /* WINVER >= 0x030a */
  4053.  
  4054. /* MDI messages */
  4055. #define WM_MDICREATE        0x0220
  4056. #define WM_MDIDESTROY        0x0221
  4057. #define WM_MDIACTIVATE        0x0222
  4058. #define WM_MDIRESTORE        0x0223
  4059. #define WM_MDINEXT        0x0224
  4060. #define WM_MDIMAXIMIZE        0x0225
  4061. #define WM_MDITILE        0x0226
  4062. #define WM_MDICASCADE        0x0227
  4063. #define WM_MDIICONARRANGE   0x0228
  4064. #define WM_MDIGETACTIVE     0x0229
  4065. #define WM_MDISETMENU        0x0230
  4066.  
  4067. /* WM_MDICREATE message structure */
  4068. typedef struct tagMDICREATESTRUCT
  4069. {
  4070.     LPCSTR  szClass;
  4071.     LPCSTR  szTitle;
  4072.     HINSTANCE hOwner;
  4073.     int     x;
  4074.     int     y;
  4075.     int     cx;
  4076.     int     cy;
  4077.     DWORD   style;
  4078.     LPARAM  lParam;
  4079. } MDICREATESTRUCT;
  4080. typedef MDICREATESTRUCT FAR*  LPMDICREATESTRUCT;
  4081.  
  4082. #if (WINVER >= 0x030a)
  4083. /* wParam values for WM_MDITILE and WM_MDICASCADE messages. */
  4084. #define MDITILE_VERTICAL    0x0000
  4085. #define MDITILE_HORIZONTAL    0x0001
  4086. #define MDITILE_SKIPDISABLED    0x0002
  4087. #endif /* WINVER >= 0x030a */
  4088.  
  4089. #define WM_CHILDACTIVATE    0x0022
  4090.  
  4091. LRESULT WINAPI DefFrameProc(HWND, HWND, UINT, WPARAM, LPARAM);
  4092. LRESULT WINAPI DefMDIChildProc(HWND, UINT, WPARAM, LPARAM);
  4093.  
  4094. #ifndef NOMSG
  4095. BOOL    WINAPI TranslateMDISysAccel(HWND, MSG FAR*);
  4096. #endif
  4097.  
  4098. UINT    WINAPI ArrangeIconicWindows(HWND);
  4099.  
  4100. #endif /* NOMDI */
  4101.  
  4102. /****** Dialog and Control Management ***************************************/
  4103.  
  4104. #ifndef NOCTLMGR
  4105.  
  4106. /* Dialog window class */
  4107. #define WC_DIALOG    (MAKEINTATOM(0x8002))
  4108.  
  4109. /* cbWndExtra bytes needed by dialog manager for dialog classes */
  4110. #define DLGWINDOWEXTRA    30
  4111.  
  4112. /* Dialog styles */
  4113. #define DS_ABSALIGN        0x01L
  4114. #define DS_SYSMODAL        0x02L
  4115. #define DS_LOCALEDIT        0x20L
  4116. #define DS_SETFONT          0x40L
  4117. #define DS_MODALFRAME       0x80L
  4118. #define DS_NOIDLEMSG        0x100L
  4119.  
  4120. /* Dialog messages */
  4121. #define DM_GETDEFID        (WM_USER+0)
  4122. #define DM_SETDEFID        (WM_USER+1)
  4123.  
  4124. /* Returned in HIWORD() of DM_GETDEFID result if msg is supported */
  4125. #define DC_HASDEFID        0x534B
  4126.  
  4127. #endif /* NOCTLMGR */
  4128.  
  4129. /* Dialog notification messages */
  4130. #define WM_INITDIALOG        0x0110
  4131. #define WM_NEXTDLGCTL        0x0028
  4132.  
  4133. #define WM_PARENTNOTIFY     0x0210
  4134.  
  4135. #define WM_ENTERIDLE        0x0121
  4136.  
  4137.  
  4138. #ifndef NOCTLMGR
  4139.  
  4140. #ifdef STRICT
  4141. typedef BOOL (CALLBACK* DLGPROC)(HWND, UINT, WPARAM, LPARAM);
  4142. #else
  4143. typedef FARPROC DLGPROC;
  4144. #endif
  4145.  
  4146. /* Get/SetWindowWord/Long offsets for use with WC_DIALOG windows */
  4147. #define DWL_MSGRESULT    0
  4148. #define DWL_DLGPROC    4
  4149. #define DWL_USER    8
  4150.  
  4151. #ifndef NOMSG
  4152. BOOL    WINAPI IsDialogMessage(HWND, MSG FAR*);
  4153. #endif
  4154.  
  4155. LRESULT WINAPI DefDlgProc(HWND, UINT, WPARAM, LPARAM);
  4156.  
  4157. HWND    WINAPI CreateDialog(HINSTANCE, LPCSTR, HWND, DLGPROC);
  4158. HWND    WINAPI CreateDialogIndirect(HINSTANCE, const void FAR*, HWND, DLGPROC);
  4159. HWND    WINAPI CreateDialogParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
  4160. HWND    WINAPI CreateDialogIndirectParam(HINSTANCE, const void FAR*, HWND, DLGPROC, LPARAM);
  4161.  
  4162. int     WINAPI DialogBox(HINSTANCE, LPCSTR, HWND, DLGPROC);
  4163. int     WINAPI DialogBoxIndirect(HINSTANCE, HGLOBAL, HWND, DLGPROC);
  4164. int     WINAPI DialogBoxParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
  4165. int     WINAPI DialogBoxIndirectParam(HINSTANCE, HGLOBAL, HWND, DLGPROC, LPARAM);
  4166.  
  4167. void    WINAPI EndDialog(HWND, int);
  4168.  
  4169. int     WINAPI GetDlgCtrlID(HWND);
  4170. HWND    WINAPI GetDlgItem(HWND, int);
  4171. LRESULT WINAPI SendDlgItemMessage(HWND, int, UINT, WPARAM, LPARAM);
  4172.  
  4173. void    WINAPI SetDlgItemInt(HWND, int, UINT, BOOL);
  4174. UINT    WINAPI GetDlgItemInt(HWND, int, BOOL FAR* , BOOL);
  4175.  
  4176. void    WINAPI SetDlgItemText(HWND, int, LPCSTR);
  4177. int     WINAPI GetDlgItemText(HWND, int, LPSTR, int);
  4178.  
  4179. void    WINAPI CheckDlgButton(HWND, int, UINT);
  4180. void    WINAPI CheckRadioButton(HWND, int, int, int);
  4181. UINT    WINAPI IsDlgButtonChecked(HWND, int);
  4182.  
  4183. HWND    WINAPI GetNextDlgGroupItem(HWND, HWND, BOOL);
  4184. HWND    WINAPI GetNextDlgTabItem(HWND, HWND, BOOL);
  4185.  
  4186. void    WINAPI MapDialogRect(HWND, RECT FAR*);
  4187. DWORD   WINAPI GetDialogBaseUnits(void);
  4188.  
  4189. #define WM_GETDLGCODE        0x0087
  4190.  
  4191. /* dialog codes */
  4192. #define DLGC_WANTARROWS     0x0001
  4193. #define DLGC_WANTTAB        0x0002
  4194. #define DLGC_WANTALLKEYS    0x0004
  4195. #define DLGC_WANTMESSAGE    0x0004
  4196. #define DLGC_HASSETSEL      0x0008
  4197. #define DLGC_DEFPUSHBUTTON  0x0010
  4198. #define DLGC_UNDEFPUSHBUTTON 0x0020
  4199. #define DLGC_RADIOBUTTON    0x0040
  4200. #define DLGC_WANTCHARS      0x0080
  4201. #define DLGC_STATIC         0x0100
  4202. #define DLGC_BUTTON         0x2000
  4203.  
  4204. #define WM_CTLCOLOR        0x0019
  4205.  
  4206. /* WM_CTLCOLOR control IDs */
  4207. #define CTLCOLOR_MSGBOX     0
  4208. #define CTLCOLOR_EDIT        1
  4209. #define CTLCOLOR_LISTBOX    2
  4210. #define CTLCOLOR_BTN        3
  4211. #define CTLCOLOR_DLG        4
  4212. #define CTLCOLOR_SCROLLBAR  5
  4213. #define CTLCOLOR_STATIC     6
  4214.  
  4215. #define WM_SETFONT          0x0030
  4216. #define WM_GETFONT        0x0031
  4217.  
  4218. #endif /* NOCTLMGR */
  4219.  
  4220. /* Standard dialog button IDs */
  4221. #define IDOK            1
  4222. #define IDCANCEL        2
  4223. #define IDABORT         3
  4224. #define IDRETRY         4
  4225. #define IDIGNORE        5
  4226. #define IDYES            6
  4227. #define IDNO            7
  4228.  
  4229. /****** Owner draw control support ******************************************/
  4230.  
  4231. /* Owner draw control types */
  4232. #define ODT_MENU    1
  4233. #define ODT_LISTBOX    2
  4234. #define ODT_COMBOBOX    3
  4235. #define ODT_BUTTON    4
  4236.  
  4237. /* Owner draw actions */
  4238. #define ODA_DRAWENTIRE    0x0001
  4239. #define ODA_SELECT    0x0002
  4240. #define ODA_FOCUS    0x0004
  4241.  
  4242. /* Owner draw state */
  4243. #define ODS_SELECTED    0x0001
  4244. #define ODS_GRAYED    0x0002
  4245. #define ODS_DISABLED    0x0004
  4246. #define ODS_CHECKED    0x0008
  4247. #define ODS_FOCUS    0x0010
  4248.  
  4249. #define WM_DRAWITEM         0x002B
  4250.  
  4251. typedef struct tagDRAWITEMSTRUCT
  4252. {
  4253.     UINT        CtlType;
  4254.     UINT        CtlID;
  4255.     UINT        itemID;
  4256.     UINT        itemAction;
  4257.     UINT        itemState;
  4258.     HWND    hwndItem;
  4259.     HDC        hDC;
  4260.     RECT    rcItem;
  4261.     DWORD       itemData;
  4262. } DRAWITEMSTRUCT;
  4263. typedef DRAWITEMSTRUCT NEAR* PDRAWITEMSTRUCT;
  4264. typedef DRAWITEMSTRUCT FAR* LPDRAWITEMSTRUCT;
  4265.  
  4266. #define WM_MEASUREITEM      0x002C
  4267.  
  4268. typedef struct tagMEASUREITEMSTRUCT
  4269. {
  4270.     UINT        CtlType;
  4271.     UINT        CtlID;
  4272.     UINT        itemID;
  4273.     UINT        itemWidth;
  4274.     UINT        itemHeight;
  4275.     DWORD       itemData;
  4276. } MEASUREITEMSTRUCT;
  4277. typedef MEASUREITEMSTRUCT NEAR* PMEASUREITEMSTRUCT;
  4278. typedef MEASUREITEMSTRUCT FAR* LPMEASUREITEMSTRUCT;
  4279.  
  4280. #define WM_DELETEITEM       0x002D
  4281.  
  4282. typedef struct tagDELETEITEMSTRUCT
  4283. {
  4284.     UINT       CtlType;
  4285.     UINT       CtlID;
  4286.     UINT       itemID;
  4287.     HWND       hwndItem;
  4288.     DWORD      itemData;
  4289. } DELETEITEMSTRUCT;
  4290. typedef DELETEITEMSTRUCT NEAR* PDELETEITEMSTRUCT;
  4291. typedef DELETEITEMSTRUCT FAR* LPDELETEITEMSTRUCT;
  4292.  
  4293. #define WM_COMPAREITEM        0x0039
  4294.  
  4295. typedef struct tagCOMPAREITEMSTRUCT
  4296. {
  4297.     UINT        CtlType;
  4298.     UINT        CtlID;
  4299.     HWND    hwndItem;
  4300.     UINT        itemID1;
  4301.     DWORD       itemData1;
  4302.     UINT        itemID2;
  4303.     DWORD       itemData2;
  4304. } COMPAREITEMSTRUCT;
  4305. typedef COMPAREITEMSTRUCT NEAR* PCOMPAREITEMSTRUCT;
  4306. typedef COMPAREITEMSTRUCT FAR* LPCOMPAREITEMSTRUCT;
  4307.  
  4308. /****** Static control ******************************************************/
  4309.  
  4310. #ifndef NOCTLMGR
  4311.  
  4312. /* Static Control Styles */
  4313. #define SS_LEFT         0x00000000L
  4314. #define SS_CENTER        0x00000001L
  4315. #define SS_RIGHT        0x00000002L
  4316. #define SS_ICON         0x00000003L
  4317. #define SS_BLACKRECT        0x00000004L
  4318. #define SS_GRAYRECT        0x00000005L
  4319. #define SS_WHITERECT        0x00000006L
  4320. #define SS_BLACKFRAME        0x00000007L
  4321. #define SS_GRAYFRAME        0x00000008L
  4322. #define SS_WHITEFRAME        0x00000009L
  4323. #define SS_SIMPLE        0x0000000BL
  4324. #define SS_LEFTNOWORDWRAP   0x0000000CL
  4325. #define SS_NOPREFIX         0x00000080L
  4326.  
  4327. #if (WINVER >= 0x030a)
  4328. #ifndef NOWINMESSAGES
  4329. /* Static Control Mesages */
  4330. #define STM_SETICON        (WM_USER+0)
  4331. #define STM_GETICON        (WM_USER+1)
  4332. #endif /* NOWINMESSAGES */
  4333. #endif /* WINVER >= 0x030a */
  4334.  
  4335. #endif /* NOCTLMGR */
  4336.  
  4337. /****** Button control *****************************************************/
  4338.  
  4339. #ifndef NOCTLMGR
  4340.  
  4341. /* Button Control Styles */
  4342. #define BS_PUSHBUTTON        0x00000000L
  4343. #define BS_DEFPUSHBUTTON    0x00000001L
  4344. #define BS_CHECKBOX        0x00000002L
  4345. #define BS_AUTOCHECKBOX     0x00000003L
  4346. #define BS_RADIOBUTTON        0x00000004L
  4347. #define BS_3STATE        0x00000005L
  4348. #define BS_AUTO3STATE        0x00000006L
  4349. #define BS_GROUPBOX        0x00000007L
  4350. #define BS_USERBUTTON        0x00000008L
  4351. #define BS_AUTORADIOBUTTON  0x00000009L
  4352. #define BS_OWNERDRAW        0x0000000BL
  4353. #define BS_LEFTTEXT        0x00000020L
  4354.  
  4355. /* Button Control Messages  */
  4356. #define BM_GETCHECK        (WM_USER+0)
  4357. #define BM_SETCHECK        (WM_USER+1)
  4358. #define BM_GETSTATE        (WM_USER+2)
  4359. #define BM_SETSTATE        (WM_USER+3)
  4360. #define BM_SETSTYLE        (WM_USER+4)
  4361.  
  4362. /* User Button Notification Codes */
  4363. #define BN_CLICKED        0
  4364. #define BN_PAINT        1
  4365. #define BN_HILITE        2
  4366. #define BN_UNHILITE        3
  4367. #define BN_DISABLE        4
  4368. #define BN_DOUBLECLICKED    5
  4369.  
  4370. #endif /* NOCTLMGR */
  4371.  
  4372. /****** Edit control *******************************************************/
  4373.  
  4374. #ifndef NOCTLMGR
  4375.  
  4376. /* Edit control styles */
  4377. #ifndef NOWINSTYLES
  4378. #define ES_LEFT         0x00000000L
  4379. #define ES_CENTER        0x00000001L
  4380. #define ES_RIGHT        0x00000002L
  4381. #define ES_MULTILINE        0x00000004L
  4382. #define ES_UPPERCASE        0x00000008L
  4383. #define ES_LOWERCASE        0x00000010L
  4384. #define ES_PASSWORD         0x00000020L
  4385. #define ES_AUTOVSCROLL        0x00000040L
  4386. #define ES_AUTOHSCROLL        0x00000080L
  4387. #define ES_NOHIDESEL        0x00000100L
  4388. #define ES_OEMCONVERT        0x00000400L
  4389. #if (WINVER >= 0x030a)
  4390. #define ES_READONLY        0x00000800L
  4391. #define ES_WANTRETURN       0x00001000L
  4392. #endif  /* WINVER >= 0x030a */
  4393. #endif /* NOWINSTYLES */
  4394.  
  4395. /* Edit control messages */
  4396. #ifndef NOWINMESSAGES
  4397. #define EM_GETSEL            (WM_USER+0)
  4398. #define EM_SETSEL            (WM_USER+1)
  4399. #define EM_GETRECT            (WM_USER+2)
  4400. #define EM_SETRECT            (WM_USER+3)
  4401. #define EM_SETRECTNP            (WM_USER+4)
  4402. #define EM_LINESCROLL            (WM_USER+6)
  4403. #define EM_GETMODIFY            (WM_USER+8)
  4404. #define EM_SETMODIFY            (WM_USER+9)
  4405. #define EM_GETLINECOUNT         (WM_USER+10)
  4406. #define EM_LINEINDEX            (WM_USER+11)
  4407. #define EM_SETHANDLE            (WM_USER+12)
  4408. #define EM_GETHANDLE            (WM_USER+13)
  4409. #define EM_GETTHUMB            (WM_USER+14)
  4410. #define EM_LINELENGTH            (WM_USER+17)
  4411. #define EM_REPLACESEL            (WM_USER+18)
  4412. #define EM_SETFONT            (WM_USER+19)
  4413. #define EM_GETLINE            (WM_USER+20)
  4414. #define EM_LIMITTEXT            (WM_USER+21)
  4415. #define EM_CANUNDO            (WM_USER+22)
  4416. #define EM_UNDO             (WM_USER+23)
  4417. #define EM_FMTLINES            (WM_USER+24)
  4418. #define EM_LINEFROMCHAR         (WM_USER+25)
  4419. #define EM_SETWORDBREAK         (WM_USER+26)    /* NOT IMPLEMENTED: use EM_SETWORDBREAK */
  4420. #define EM_SETTABSTOPS            (WM_USER+27)
  4421. #define EM_SETPASSWORDCHAR      (WM_USER+28)
  4422. #define EM_EMPTYUNDOBUFFER      (WM_USER+29)
  4423. #if (WINVER >= 0x030a)
  4424. #define EM_GETFIRSTVISIBLELINE    (WM_USER+30)
  4425. #define EM_SETREADONLY            (WM_USER+31)
  4426. #define EM_SETWORDBREAKPROC     (WM_USER+32)
  4427. #define EM_GETWORDBREAKPROC     (WM_USER+33)
  4428. #define EM_GETPASSWORDCHAR      (WM_USER+34)
  4429. #endif /* WINVER >= 0x030a */
  4430. #endif /* NOWINMESSAGES */
  4431.  
  4432.  
  4433. #if (WINVER >= 0x030a)
  4434.  
  4435. typedef int   (CALLBACK* EDITWORDBREAKPROC)(LPSTR lpch, int ichCurrent, int cch, int code);
  4436.  
  4437. /* EDITWORDBREAKPROC code values */
  4438. #define WB_LEFT           0
  4439. #define WB_RIGHT       1
  4440. #define WB_ISDELIMITER     2
  4441. #endif
  4442.  
  4443. /* Edit control notification codes */
  4444. #define EN_SETFOCUS        0x0100
  4445. #define EN_KILLFOCUS        0x0200
  4446. #define EN_CHANGE        0x0300
  4447. #define EN_UPDATE        0x0400
  4448. #define EN_ERRSPACE        0x0500
  4449. #define EN_MAXTEXT        0x0501
  4450. #define EN_HSCROLL        0x0601
  4451. #define EN_VSCROLL        0x0602
  4452.  
  4453. #endif /* NOCTLMGR */
  4454.  
  4455. /****** Scroll bar control *************************************************/
  4456. /* Also see scrolling support */
  4457.  
  4458. #ifndef NOCTLMGR
  4459.  
  4460. #ifndef NOWINSTYLES
  4461.  
  4462. /* Scroll bar styles */
  4463. #define SBS_HORZ            0x0000L
  4464. #define SBS_VERT            0x0001L
  4465. #define SBS_TOPALIGN            0x0002L
  4466. #define SBS_LEFTALIGN            0x0002L
  4467. #define SBS_BOTTOMALIGN            0x0004L
  4468. #define SBS_RIGHTALIGN            0x0004L
  4469. #define SBS_SIZEBOXTOPLEFTALIGN        0x0002L
  4470. #define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
  4471. #define SBS_SIZEBOX            0x0008L
  4472.  
  4473. #endif /* NOWINSTYLES */
  4474.  
  4475. #endif /* NOCTLMGR */
  4476.  
  4477. /****** Listbox control ****************************************************/
  4478.  
  4479. #ifndef NOCTLMGR
  4480.  
  4481. /* Listbox styles */
  4482. #ifndef NOWINSTYLES
  4483. #define LBS_NOTIFY          0x0001L
  4484. #define LBS_SORT          0x0002L
  4485. #define LBS_NOREDRAW          0x0004L
  4486. #define LBS_MULTIPLESEL       0x0008L
  4487. #define LBS_OWNERDRAWFIXED    0x0010L
  4488. #define LBS_OWNERDRAWVARIABLE 0x0020L
  4489. #define LBS_HASSTRINGS        0x0040L
  4490. #define LBS_USETABSTOPS       0x0080L
  4491. #define LBS_NOINTEGRALHEIGHT  0x0100L
  4492. #define LBS_MULTICOLUMN       0x0200L
  4493. #define LBS_WANTKEYBOARDINPUT 0x0400L
  4494. #define LBS_EXTENDEDSEL          0x0800L
  4495. #if (WINVER >= 0x030a)
  4496. #define LBS_DISABLENOSCROLL   0x1000L
  4497. #endif /* WINVER >= 0x030a */
  4498. #define LBS_STANDARD          (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
  4499. #endif /* NOWINSTYLES */
  4500.  
  4501. /* Listbox messages */
  4502. #ifndef NOWINMESSAGES
  4503. #define LB_ADDSTRING           (WM_USER+1)
  4504. #define LB_INSERTSTRING        (WM_USER+2)
  4505. #define LB_DELETESTRING        (WM_USER+3)
  4506. #define LB_RESETCONTENT        (WM_USER+5)
  4507. #define LB_SETSEL           (WM_USER+6)
  4508. #define LB_SETCURSEL           (WM_USER+7)
  4509. #define LB_GETSEL           (WM_USER+8)
  4510. #define LB_GETCURSEL           (WM_USER+9)
  4511. #define LB_GETTEXT           (WM_USER+10)
  4512. #define LB_GETTEXTLEN           (WM_USER+11)
  4513. #define LB_GETCOUNT           (WM_USER+12)
  4514. #define LB_SELECTSTRING        (WM_USER+13)
  4515. #define LB_DIR               (WM_USER+14)
  4516. #define LB_GETTOPINDEX           (WM_USER+15)
  4517. #define LB_FINDSTRING           (WM_USER+16)
  4518. #define LB_GETSELCOUNT           (WM_USER+17)
  4519. #define LB_GETSELITEMS           (WM_USER+18)
  4520. #define LB_SETTABSTOPS         (WM_USER+19)
  4521. #define LB_GETHORIZONTALEXTENT (WM_USER+20)
  4522. #define LB_SETHORIZONTALEXTENT (WM_USER+21)
  4523. #define LB_SETCOLUMNWIDTH      (WM_USER+22)
  4524. #define LB_SETTOPINDEX           (WM_USER+24)
  4525. #define LB_GETITEMRECT           (WM_USER+25)
  4526. #define LB_GETITEMDATA         (WM_USER+26)
  4527. #define LB_SETITEMDATA         (WM_USER+27)
  4528. #define LB_SELITEMRANGE        (WM_USER+28)
  4529. #define LB_SETCARETINDEX       (WM_USER+31)
  4530. #define LB_GETCARETINDEX       (WM_USER+32)
  4531.  
  4532. #if (WINVER >= 0x030a)
  4533. #define LB_SETITEMHEIGHT       (WM_USER+33)
  4534. #define LB_GETITEMHEIGHT       (WM_USER+34)
  4535. #endif  /* WINVER >= 0x030a */
  4536.  
  4537. #endif /* NOWINMESSAGES */
  4538.  
  4539. /* Listbox notification codes */
  4540. #define LBN_ERRSPACE        (-2)
  4541. #define LBN_SELCHANGE        1
  4542. #define LBN_DBLCLK        2
  4543. #define LBN_SELCANCEL       3
  4544. #define LBN_SETFOCUS        4
  4545. #define LBN_KILLFOCUS       5
  4546.  
  4547. /* Listbox notification messages */
  4548. #define WM_VKEYTOITEM       0x002E
  4549. #define WM_CHARTOITEM       0x002F
  4550.  
  4551. /* Listbox message return values */
  4552. #define LB_OKAY         0
  4553. #define LB_ERR            (-1)
  4554. #define LB_ERRSPACE        (-2)
  4555.  
  4556. #define LB_CTLCODE        0L
  4557.  
  4558. /****** Dialog directory support ********************************************/
  4559.  
  4560. int     WINAPI DlgDirList(HWND, LPSTR, int, int, UINT);
  4561. BOOL    WINAPI DlgDirSelect(HWND, LPSTR, int);
  4562.  
  4563. int     WINAPI DlgDirListComboBox(HWND, LPSTR, int, int, UINT);
  4564. BOOL    WINAPI DlgDirSelectComboBox(HWND, LPSTR, int);
  4565.  
  4566. #if (WINVER >= 0x030a)
  4567. BOOL    WINAPI DlgDirSelectEx(HWND, LPSTR, int, int);
  4568. BOOL    WINAPI DlgDirSelectComboBoxEx(HWND, LPSTR, int, int);
  4569. #endif
  4570.  
  4571.  
  4572. /* DlgDirList, DlgDirListComboBox flags values */
  4573. #define DDL_READWRITE       0x0000
  4574. #define DDL_READONLY        0x0001
  4575. #define DDL_HIDDEN          0x0002
  4576. #define DDL_SYSTEM          0x0004
  4577. #define DDL_DIRECTORY        0x0010
  4578. #define DDL_ARCHIVE        0x0020
  4579.  
  4580. #define DDL_POSTMSGS        0x2000
  4581. #define DDL_DRIVES        0x4000
  4582. #define DDL_EXCLUSIVE        0x8000
  4583.  
  4584. #endif /* NOCTLMGR */
  4585.  
  4586. /****** Combo box control **************************************************/
  4587.  
  4588. #ifndef NOCTLMGR
  4589.  
  4590. /* Combo box styles */
  4591. #ifndef NOWINSTYLES
  4592. #define CBS_SIMPLE          0x0001L
  4593. #define CBS_DROPDOWN          0x0002L
  4594. #define CBS_DROPDOWNLIST      0x0003L
  4595. #define CBS_OWNERDRAWFIXED    0x0010L
  4596. #define CBS_OWNERDRAWVARIABLE 0x0020L
  4597. #define CBS_AUTOHSCROLL       0x0040L
  4598. #define CBS_OEMCONVERT        0x0080L
  4599. #define CBS_SORT              0x0100L
  4600. #define CBS_HASSTRINGS        0x0200L
  4601. #define CBS_NOINTEGRALHEIGHT  0x0400L
  4602. #if (WINVER >= 0x030a)
  4603. #define CBS_DISABLENOSCROLL   0x0800L
  4604. #endif  /* WINVER >= 0x030a */
  4605. #endif  /* NOWINSTYLES */
  4606.  
  4607. /* Combo box messages */
  4608. #ifndef NOWINMESSAGES
  4609. #define CB_GETEDITSEL             (WM_USER+0)
  4610. #define CB_LIMITTEXT             (WM_USER+1)
  4611. #define CB_SETEDITSEL             (WM_USER+2)
  4612. #define CB_ADDSTRING             (WM_USER+3)
  4613. #define CB_DELETESTRING             (WM_USER+4)
  4614. #define CB_DIR                   (WM_USER+5)
  4615. #define CB_GETCOUNT             (WM_USER+6)
  4616. #define CB_GETCURSEL             (WM_USER+7)
  4617. #define CB_GETLBTEXT             (WM_USER+8)
  4618. #define CB_GETLBTEXTLEN             (WM_USER+9)
  4619. #define CB_INSERTSTRING          (WM_USER+10)
  4620. #define CB_RESETCONTENT             (WM_USER+11)
  4621. #define CB_FINDSTRING             (WM_USER+12)
  4622. #define CB_SELECTSTRING             (WM_USER+13)
  4623. #define CB_SETCURSEL             (WM_USER+14)
  4624. #define CB_SHOWDROPDOWN          (WM_USER+15)
  4625. #define CB_GETITEMDATA           (WM_USER+16)
  4626. #define CB_SETITEMDATA           (WM_USER+17)
  4627. #if (WINVER >= 0x030a)
  4628. #define CB_GETDROPPEDCONTROLRECT (WM_USER+18)
  4629. #define CB_SETITEMHEIGHT         (WM_USER+19)
  4630. #define CB_GETITEMHEIGHT         (WM_USER+20)
  4631. #define CB_SETEXTENDEDUI         (WM_USER+21)
  4632. #define CB_GETEXTENDEDUI         (WM_USER+22)
  4633. #define CB_GETDROPPEDSTATE       (WM_USER+23)
  4634. #endif  /* WINVER >= 0x030a */
  4635.  
  4636. #endif  /* NOWINMESSAGES */
  4637.  
  4638. /* Combo box notification codes */
  4639. #define CBN_ERRSPACE        (-1)
  4640. #define CBN_SELCHANGE        1
  4641. #define CBN_DBLCLK        2
  4642. #define CBN_SETFOCUS        3
  4643. #define CBN_KILLFOCUS        4
  4644. #define CBN_EDITCHANGE      5
  4645. #define CBN_EDITUPDATE      6
  4646. #define CBN_DROPDOWN        7
  4647. #if (WINVER >= 0x030a)
  4648. #define CBN_CLOSEUP         8
  4649. #define CBN_SELENDOK        9
  4650. #define CBN_SELENDCANCEL    10
  4651. #endif /* WINVER >= 0x030a */
  4652.  
  4653. /* Combo box message return values */
  4654. #define CB_OKAY         0
  4655. #define CB_ERR            (-1)
  4656. #define CB_ERRSPACE        (-2)
  4657.  
  4658. #endif    /* NOCTLMGR */
  4659.  
  4660. /******* Windows hook support **********************************************/
  4661.  
  4662. #ifndef NOWH
  4663.  
  4664. typedef DWORD HHOOK;
  4665.  
  4666. #ifdef STRICT
  4667. typedef LRESULT (CALLBACK* HOOKPROC)(int code, WPARAM wParam, LPARAM lParam);
  4668. #else
  4669. typedef FARPROC HOOKPROC;
  4670. #endif
  4671.  
  4672. #ifdef STRICT
  4673. HHOOK   WINAPI SetWindowsHook(int, HOOKPROC);
  4674. DWORD   WINAPI DefHookProc(int, UINT, DWORD, HHOOK FAR* );
  4675. #else
  4676. HOOKPROC WINAPI SetWindowsHook(int, HOOKPROC);
  4677. DWORD   WINAPI DefHookProc(int, UINT, DWORD, HOOKPROC FAR* );
  4678. #endif
  4679. BOOL    WINAPI UnhookWindowsHook(int, HOOKPROC);
  4680.  
  4681. #if (WINVER >= 0x030a)
  4682.  
  4683. HHOOK   WINAPI SetWindowsHookEx(int idHook, HOOKPROC lpfn, HINSTANCE hInstance, HTASK hTask);
  4684. BOOL    WINAPI UnhookWindowsHookEx(HHOOK hHook);
  4685. LRESULT WINAPI CallNextHookEx(HHOOK hHook, int code, WPARAM wParam, LPARAM lParam);
  4686.  
  4687. #endif  /* WINVER >= 0x030a */
  4688.  
  4689.  
  4690. /* Standard hook code */
  4691. #define HC_ACTION        0
  4692.  
  4693. /* Obsolete hook codes (NO LONGER SUPPORTED) */
  4694. #define HC_GETLPLPFN        (-3)
  4695. #define HC_LPLPFNNEXT        (-2)
  4696. #define HC_LPFNNEXT        (-1)
  4697.  
  4698. #endif    /* NOWH */
  4699.  
  4700. /****** Computer-based-training (CBT) support *******************************/
  4701.  
  4702. #define WM_QUEUESYNC        0x0023
  4703.  
  4704. #ifndef NOWH
  4705.  
  4706. /* SetWindowsHook() code */
  4707. #define WH_CBT            5
  4708.  
  4709. #define HCBT_MOVESIZE        0
  4710. #define HCBT_MINMAX        1
  4711. #define HCBT_QS         2
  4712. #define HCBT_CREATEWND        3
  4713. #define HCBT_DESTROYWND        4
  4714. #define HCBT_ACTIVATE        5
  4715. #define HCBT_CLICKSKIPPED   6
  4716. #define HCBT_KEYSKIPPED     7
  4717. #define HCBT_SYSCOMMAND        8
  4718. #define HCBT_SETFOCUS        9
  4719.  
  4720. #if (WINVER >= 0x030a)
  4721. /* HCBT_CREATEWND parameters pointed to by lParam */
  4722. typedef struct tagCBT_CREATEWND
  4723. {
  4724.     CREATESTRUCT FAR* lpcs;
  4725.     HWND    hwndInsertAfter;
  4726. } CBT_CREATEWND;
  4727. typedef CBT_CREATEWND FAR* LPCBT_CREATEWND;
  4728.  
  4729. /* HCBT_ACTIVATE structure pointed to by lParam */
  4730. typedef struct tagCBTACTIVATESTRUCT
  4731. {
  4732.     BOOL    fMouse;
  4733.     HWND    hWndActive;
  4734. } CBTACTIVATESTRUCT;
  4735.  
  4736. #endif  /* WINVER >= 0x030a */
  4737. #endif    /* NOWH */
  4738.  
  4739. /****** Hardware hook support ***********************************************/
  4740.  
  4741. #ifndef NOWH
  4742. #if (WINVER >= 0x030a)
  4743. #define WH_HARDWARE        8
  4744.  
  4745. typedef struct tagHARDWAREHOOKSTRUCT
  4746. {
  4747.     HWND    hWnd;
  4748.     UINT    wMessage;
  4749.     WPARAM  wParam;
  4750.     LPARAM  lParam;
  4751. } HARDWAREHOOKSTRUCT;
  4752. #endif /* WINVER >= 0x030a */
  4753. #endif /* NOWH */
  4754.  
  4755. /****** Shell support *******************************************************/
  4756.  
  4757. #ifndef NOWH
  4758. #if (WINVER >= 0x030a)
  4759. /* SetWindowsHook() Shell hook code */
  4760. #define WH_SHELL           10
  4761.  
  4762. #define HSHELL_WINDOWCREATED       1
  4763. #define HSHELL_WINDOWDESTROYED     2
  4764. #define HSHELL_ACTIVATESHELLWINDOW 3
  4765.  
  4766. #endif /* WINVER >= 0x030a */
  4767. #endif /* NOWH */
  4768.  
  4769. /****** Journalling support *************************************************/
  4770.  
  4771. #ifndef NOWH
  4772. #define WH_JOURNALRECORD    0
  4773. #define WH_JOURNALPLAYBACK  1
  4774.  
  4775. /* Journalling hook codes */
  4776. #define HC_GETNEXT        1
  4777. #define HC_SKIP         2
  4778. #define HC_NOREMOVE        3
  4779. #define HC_NOREM        HC_NOREMOVE
  4780. #define HC_SYSMODALON       4
  4781. #define HC_SYSMODALOFF        5
  4782.  
  4783. /* Journalling message structure */
  4784. typedef struct tagEVENTMSG
  4785. {
  4786.     UINT    message;
  4787.     UINT    paramL;
  4788.     UINT    paramH;
  4789.     DWORD   time;
  4790. } EVENTMSG;
  4791. typedef EVENTMSG *PEVENTMSG;                    
  4792. typedef EVENTMSG NEAR* NPEVENTMSG;
  4793. typedef EVENTMSG FAR* LPEVENTMSG;
  4794.  
  4795. BOOL    WINAPI EnableHardwareInput(BOOL);
  4796.  
  4797. #endif    /* NOWH */
  4798.  
  4799.  
  4800. /****** Debugger support ****************************************************/
  4801.  
  4802. #if (WINVER >= 0x030a)
  4803. /* SetWindowsHook debug hook support */
  4804. #define WH_DEBUG        9
  4805.  
  4806. typedef struct tagDEBUGHOOKINFO
  4807. {
  4808.     HMODULE    hModuleHook;
  4809.     LPARAM    reserved;
  4810.     LPARAM    lParam;
  4811.     WPARAM    wParam;
  4812.     int         code;
  4813. } DEBUGHOOKINFO;
  4814. typedef DEBUGHOOKINFO FAR* LPDEBUGHOOKINFO;
  4815.  
  4816. #ifndef NOMSG
  4817. BOOL WINAPI QuerySendMessage(HANDLE h1, HANDLE h2, HANDLE h3, LPMSG lpmsg);
  4818. #endif  /* NOMSG */
  4819.  
  4820. BOOL WINAPI LockInput(HANDLE h1, HWND hwndInput, BOOL fLock);
  4821.  
  4822. LONG WINAPI GetSystemDebugState(void);
  4823. /* Flags returned by GetSystemDebugState. 
  4824.  */
  4825. #define SDS_MENU        0x0001
  4826. #define SDS_SYSMODAL    0x0002
  4827. #define SDS_NOTASKQUEUE 0x0004
  4828. #define SDS_DIALOG      0x0008
  4829. #define SDS_TASKLOCKED  0x0010
  4830. #endif  /* WINVER >= 0x030a */
  4831.  
  4832.  
  4833. /****** Help support ********************************************************/
  4834.  
  4835. #ifndef NOHELP
  4836.  
  4837. BOOL WINAPI WinHelp(HWND hwndMain, LPCSTR lpszHelp, UINT usCommand, DWORD ulData);
  4838.  
  4839. /* WinHelp() commands */
  4840. #define HELP_CONTEXT      0x0001
  4841. #define HELP_QUIT         0x0002
  4842. #define HELP_INDEX        0x0003
  4843. #define HELP_CONTENTS     0x0003
  4844. #define HELP_HELPONHELP   0x0004
  4845. #define HELP_SETINDEX     0x0005
  4846. #define HELP_SETCONTENTS  0x0005
  4847. #define HELP_CONTEXTPOPUP 0x0008
  4848. #define HELP_FORCEFILE    0x0009
  4849. #define HELP_KEY          0x0101
  4850. #define HELP_COMMAND      0x0102
  4851. #define HELP_PARTIALKEY   0x0105
  4852. #define HELP_MULTIKEY     0x0201
  4853. #define HELP_SETWINPOS    0x0203
  4854.  
  4855. typedef struct tagMULTIKEYHELP
  4856. {
  4857.     UINT    mkSize;
  4858.     BYTE    mkKeylist;
  4859.     BYTE    szKeyphrase[1];
  4860. } MULTIKEYHELP;
  4861.  
  4862.  
  4863. typedef struct
  4864. {
  4865.     int  wStructSize;
  4866.     int  x;
  4867.     int  y;
  4868.     int  dx;
  4869.     int  dy;
  4870.     int  wMax;
  4871.     char rgchMember[2];
  4872. } HELPWININFO;
  4873. typedef HELPWININFO NEAR* PHELPWININFO;
  4874. typedef HELPWININFO FAR* LPHELPWININFO;
  4875.  
  4876. #endif /* NOHELP */
  4877.  
  4878. /****** Sound support ******************************************************/
  4879.  
  4880. #ifndef NOSOUND
  4881.  
  4882. int     WINAPI OpenSound(void);
  4883. void    WINAPI CloseSound(void);
  4884.  
  4885. int     WINAPI StartSound(void);
  4886. int     WINAPI StopSound(void);
  4887.  
  4888. int     WINAPI SetVoiceQueueSize(int, int);
  4889. int     WINAPI SetVoiceNote(int, int, int, int);
  4890. int     WINAPI SetVoiceAccent(int, int, int, int, int);
  4891. int     WINAPI SetVoiceEnvelope(int, int, int);
  4892. int     WINAPI SetVoiceSound(int, DWORD, int);
  4893.  
  4894. int     WINAPI SetVoiceThreshold(int, int);
  4895. int FAR* WINAPI GetThresholdEvent(void);
  4896. int     WINAPI GetThresholdStatus(void);
  4897.  
  4898. int     WINAPI SetSoundNoise(int, int);
  4899.  
  4900. /* SetSoundNoise() Sources */
  4901. #define S_PERIOD512   0
  4902. #define S_PERIOD1024  1
  4903. #define S_PERIOD2048  2
  4904. #define S_PERIODVOICE 3
  4905. #define S_WHITE512    4
  4906. #define S_WHITE1024   5
  4907. #define S_WHITE2048   6
  4908. #define S_WHITEVOICE  7
  4909.  
  4910. int     WINAPI WaitSoundState(int);
  4911.  
  4912. /* WaitSoundState() constants */
  4913. #define S_QUEUEEMPTY        0
  4914. #define S_THRESHOLD        1
  4915. #define S_ALLTHRESHOLD        2
  4916.  
  4917. int     WINAPI SyncAllVoices(void);
  4918. int     WINAPI CountVoiceNotes(int);
  4919.  
  4920. /* Accent Modes */
  4921. #define S_NORMAL      0
  4922. #define S_LEGATO      1
  4923. #define S_STACCATO    2
  4924.  
  4925. /* Error return values */
  4926. #define S_SERDVNA     (-1)
  4927. #define S_SEROFM      (-2)
  4928. #define S_SERMACT     (-3)
  4929. #define S_SERQFUL     (-4)
  4930. #define S_SERBDNT     (-5)
  4931. #define S_SERDLN      (-6)
  4932. #define S_SERDCC      (-7)
  4933. #define S_SERDTP      (-8)
  4934. #define S_SERDVL      (-9)
  4935. #define S_SERDMD      (-10)
  4936. #define S_SERDSH      (-11)
  4937. #define S_SERDPT      (-12)
  4938. #define S_SERDFQ      (-13)
  4939. #define S_SERDDR      (-14)
  4940. #define S_SERDSR      (-15)
  4941. #define S_SERDST      (-16)
  4942.  
  4943. #endif /* NOSOUND */
  4944.  
  4945. /****** Comm support ******************************************************/
  4946.  
  4947. #ifndef NOCOMM
  4948.  
  4949. #define NOPARITY        0
  4950. #define ODDPARITY        1
  4951. #define EVENPARITY        2
  4952. #define MARKPARITY        3
  4953. #define SPACEPARITY        4
  4954.  
  4955. #define ONESTOPBIT        0
  4956. #define ONE5STOPBITS        1
  4957. #define TWOSTOPBITS        2
  4958.  
  4959. #define IGNORE              0
  4960. #define INFINITE            0xFFFF
  4961.  
  4962. /* Error Flags */
  4963. #define CE_RXOVER           0x0001
  4964. #define CE_OVERRUN          0x0002
  4965. #define CE_RXPARITY         0x0004
  4966. #define CE_FRAME            0x0008
  4967. #define CE_BREAK            0x0010
  4968. #define CE_CTSTO            0x0020
  4969. #define CE_DSRTO            0x0040
  4970. #define CE_RLSDTO           0x0080
  4971. #define CE_TXFULL           0x0100
  4972. #define CE_PTO              0x0200
  4973. #define CE_IOE              0x0400
  4974. #define CE_DNS              0x0800
  4975. #define CE_OOP              0x1000
  4976. #define CE_MODE             0x8000
  4977.  
  4978. #define IE_BADID            (-1)
  4979. #define IE_OPEN             (-2)
  4980. #define IE_NOPEN            (-3)
  4981. #define IE_MEMORY           (-4)
  4982. #define IE_DEFAULT          (-5)
  4983. #define IE_HARDWARE         (-10)
  4984. #define IE_BYTESIZE         (-11)
  4985. #define IE_BAUDRATE         (-12)
  4986.  
  4987. /* Events */
  4988. #define EV_RXCHAR           0x0001
  4989. #define EV_RXFLAG           0x0002
  4990. #define EV_TXEMPTY          0x0004
  4991. #define EV_CTS              0x0008
  4992. #define EV_DSR              0x0010
  4993. #define EV_RLSD             0x0020
  4994. #define EV_BREAK            0x0040
  4995. #define EV_ERR              0x0080
  4996. #define EV_RING             0x0100
  4997. #define EV_PERR             0x0200
  4998. #define EV_CTSS             0x0400
  4999. #define EV_DSRS             0x0800
  5000. #define EV_RLSDS            0x1000
  5001. #define EV_RingTe           0x2000
  5002. #define EV_RINGTE        EV_RingTe
  5003.  
  5004. /* Escape Functions */
  5005. #define SETXOFF             1
  5006. #define SETXON              2
  5007. #define SETRTS              3
  5008. #define CLRRTS              4
  5009. #define SETDTR              5
  5010. #define CLRDTR              6
  5011. #define RESETDEV            7
  5012.  
  5013. #define LPTx                0x80
  5014.  
  5015. #if (WINVER >= 0x030a)
  5016.  
  5017. /* new escape functions */
  5018. #define GETMAXLPT           8
  5019. #define GETMAXCOM           9
  5020. #define GETBASEIRQ          10
  5021.  
  5022. /* Comm Baud Rate indices */
  5023. #define CBR_110         0xFF10
  5024. #define CBR_300      0xFF11
  5025. #define CBR_600      0xFF12
  5026. #define CBR_1200     0xFF13
  5027. #define CBR_2400     0xFF14
  5028. #define CBR_4800     0xFF15
  5029. #define CBR_9600     0xFF16
  5030. #define CBR_14400    0xFF17
  5031. #define CBR_19200    0xFF18
  5032. #define CBR_38400    0xFF1B
  5033. #define CBR_56000    0xFF1F
  5034. #define CBR_128000   0xFF23
  5035. #define CBR_256000   0xFF27
  5036.  
  5037. /* notifications passed in low word of lParam on WM_COMMNOTIFY messages */
  5038. #define CN_RECEIVE  0x01
  5039. #define CN_TRANSMIT 0x02
  5040. #define CN_EVENT    0x04
  5041.  
  5042. #endif /* WINVER >= 0x030a */
  5043.  
  5044. typedef struct tagDCB
  5045. {
  5046.     BYTE Id;
  5047.     UINT BaudRate;
  5048.     BYTE ByteSize;
  5049.     BYTE Parity;
  5050.     BYTE StopBits;
  5051.     UINT RlsTimeout;
  5052.     UINT CtsTimeout;
  5053.     UINT DsrTimeout;
  5054.  
  5055.     UINT fBinary        :1;
  5056.     UINT fRtsDisable    :1;
  5057.     UINT fParity        :1;
  5058.     UINT fOutxCtsFlow   :1;
  5059.     UINT fOutxDsrFlow   :1;
  5060.     UINT fDummy         :2;
  5061.     UINT fDtrDisable    :1;
  5062.  
  5063.     UINT fOutX          :1;
  5064.     UINT fInX           :1;
  5065.     UINT fPeChar        :1;
  5066.     UINT fNull          :1;
  5067.     UINT fChEvt         :1;
  5068.     UINT fDtrflow       :1;
  5069.     UINT fRtsflow       :1;
  5070.     UINT fDummy2        :1;
  5071.  
  5072.     char XonChar;
  5073.     char XoffChar;
  5074.     UINT XonLim;
  5075.     UINT XoffLim;
  5076.     char PeChar;
  5077.     char EofChar;
  5078.     char EvtChar;
  5079.     UINT TxDelay;
  5080. } DCB;
  5081. typedef DCB FAR* LPDCB;
  5082.  
  5083. typedef struct tagCOMSTAT
  5084. {
  5085.     UINT fCtsHold  :1;
  5086.     UINT fDsrHold  :1;
  5087.     UINT fRlsdHold :1;
  5088.     UINT fXoffHold :1;
  5089.     UINT fXoffSent :1;
  5090.     UINT fEof      :1;
  5091.     UINT fTxim     :1;
  5092.  
  5093.     UINT cbInQue;
  5094.     UINT cbOutQue;
  5095. } COMSTAT;
  5096.  
  5097. int     WINAPI BuildCommDCB(LPCSTR, DCB FAR*);
  5098.  
  5099. int     WINAPI OpenComm(LPCSTR, UINT, UINT);
  5100. int     WINAPI CloseComm(int);
  5101.  
  5102. int     WINAPI ReadComm(int, void FAR*, int);
  5103. int     WINAPI WriteComm(int, const void FAR*, int);
  5104. int     WINAPI UngetCommChar(int, char);
  5105. int     WINAPI FlushComm(int, int);
  5106. int     WINAPI TransmitCommChar(int, char);
  5107.  
  5108. int     WINAPI SetCommState(const DCB FAR*);
  5109. int     WINAPI GetCommState(int, DCB FAR*);
  5110. int     WINAPI GetCommError(int, COMSTAT FAR* );
  5111.  
  5112. int     WINAPI SetCommBreak(int);
  5113. int     WINAPI ClearCommBreak(int);
  5114.  
  5115. UINT FAR* WINAPI SetCommEventMask(int, UINT);
  5116. UINT    WINAPI GetCommEventMask(int, int);
  5117.  
  5118. LONG    WINAPI EscapeCommFunction(int, int);
  5119.  
  5120. #if (WINVER >= 0x030a)
  5121. BOOL    WINAPI EnableCommNotification(int, HWND, int, int);
  5122.  
  5123. #define WM_COMMNOTIFY        0x0044
  5124. #endif  /* WINVER >= 0x030a */
  5125.  
  5126. #endif /* NOCOMM */
  5127.  
  5128. /****** String formatting support *******************************************/
  5129.  
  5130. int     WINAPI wvsprintf(LPSTR lpszOut, LPCSTR lpszFmt, const void FAR* lpParams);
  5131.  
  5132. int    FAR CDECL wsprintf(LPSTR lpszOut, LPCSTR lpszFmt, ...);
  5133.  
  5134.  
  5135. /****** Driver support ******************************************************/
  5136.  
  5137. #if (WINVER >= 0x030a)
  5138.  
  5139. #ifndef NODRIVERS
  5140.  
  5141. DECLARE_HANDLE(HDRVR);
  5142.  
  5143. /* Driver messages */
  5144. #define DRV_LOAD        0x0001
  5145. #define DRV_ENABLE        0x0002
  5146. #define DRV_OPEN        0x0003
  5147. #define DRV_CLOSE        0x0004
  5148. #define DRV_DISABLE        0x0005
  5149. #define DRV_FREE        0x0006
  5150. #define DRV_CONFIGURE        0x0007
  5151. #define DRV_QUERYCONFIGURE    0x0008
  5152. #define DRV_INSTALL        0x0009
  5153. #define DRV_REMOVE        0x000A
  5154. #define DRV_EXITSESSION         0x000B
  5155. #define DRV_EXITAPPLICATION     0x000C
  5156. #define DRV_POWER        0x000F
  5157.  
  5158. #define DRV_RESERVED        0x0800
  5159. #define DRV_USER        0x4000
  5160.  
  5161. /* LPARAM of DRV_CONFIGURE message */
  5162. typedef struct tagDRVCONFIGINFO
  5163. {
  5164.     DWORD   dwDCISize;
  5165.     LPSTR   lpszDCISectionName;
  5166.     LPSTR   lpszDCIAliasName;
  5167. } DRVCONFIGINFO;
  5168. typedef DRVCONFIGINFO NEAR* PDRVCONFIGINFO;
  5169. typedef DRVCONFIGINFO FAR* LPDRVCONFIGINFO;
  5170.  
  5171. /* Supported return values for DRV_CONFIGURE message */
  5172. #define DRVCNF_CANCEL        0x0000
  5173. #define DRVCNF_OK        0x0001
  5174. #define DRVCNF_RESTART        0x0002
  5175.  
  5176. /* Supported lParam1 of DRV_EXITAPPLICATION notification */
  5177. #define DRVEA_NORMALEXIT            0x0001
  5178. #define DRVEA_ABNORMALEXIT          0x0002
  5179.  
  5180. LRESULT WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR driverID, UINT message, LPARAM lParam1, LPARAM lParam2);
  5181.  
  5182. HDRVR   WINAPI OpenDriver(LPCSTR szDriverName, LPCSTR szSectionName, LPARAM lParam2);
  5183. LRESULT WINAPI CloseDriver(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
  5184.  
  5185. LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT message, LPARAM lParam1, LPARAM lParam2);
  5186.  
  5187. HINSTANCE WINAPI GetDriverModuleHandle(HDRVR hDriver);
  5188.  
  5189. HDRVR   WINAPI GetNextDriver(HDRVR, DWORD);
  5190.  
  5191. /* GetNextDriver flags */
  5192. #define GND_FIRSTINSTANCEONLY    0x00000001
  5193. #define GND_REVERSE        0x00000002
  5194.  
  5195. typedef struct tagDRIVERINFOSTRUCT
  5196. {
  5197.     UINT    length;
  5198.     HDRVR   hDriver;
  5199.     HINSTANCE hModule;
  5200.     char    szAliasName[128];
  5201. } DRIVERINFOSTRUCT;
  5202. typedef DRIVERINFOSTRUCT FAR* LPDRIVERINFOSTRUCT;
  5203.  
  5204. BOOL    WINAPI GetDriverInfo(HDRVR, DRIVERINFOSTRUCT FAR*);
  5205.  
  5206. #endif /* !NODRIVERS */
  5207. #endif /* WINVER >= 0x030a */
  5208. #endif /* NOUSER */
  5209.  
  5210.  
  5211. #ifndef RC_INVOKED
  5212. #pragma pack()          /* Revert to default packing */
  5213. #endif
  5214.  
  5215. #ifdef __cplusplus
  5216. }                       /* End of extern "C" { */
  5217. #endif    /* __cplusplus */
  5218.  
  5219. #endif  /* _INC_WINDOWS */
  5220.